Skip to content

For developers

FlowDrop Office has one extension point: hook_flowdrop_office_turn_alter(), documented in flowdrop_office.api.php.

Routes

Route Path Method Access
flowdrop_office.office /admin/flowdrop/workflows/{flowdrop_workflow}/office GET view flowdrop office and workflow view access
flowdrop_office.run .../office/runs/{flowdrop_pipeline} GET view flowdrop office and pipeline view access
flowdrop_office.turn .../office/turn POST view flowdrop office, execute session workflow, workflow view access and the CSRF request header token

run returns one run as JSON and answers 404 when the pipeline belongs to another workflow. turn takes a JSON body {message, session}, where session is the UUID of an earlier office session or empty for a new one.

How a live turn flows

sequenceDiagram
    participant Chat as Office chat
    participant C as OfficeController::turn
    participant H as hook_flowdrop_office_turn_alter
    participant S as FlowDrop session
    Chat->>C: POST {message, session}
    C->>H: alter(turn, workflow)
    alt stopped
        C-->>Chat: status "stopped", the stop text as answer
    else message kept
        C->>S: executeTurn(wait: TRUE), or resolve the pending question
        S-->>C: pipeline, status, answer
        C-->>Chat: answer, next question, run
    end

Services

Service Purpose
Drupal\flowdrop_office\OfficeData Builds the graph of a workflow, the recent runs, and one run's jobs in execution order with trimmed outputs
logger.channel.flowdrop_office Log channel for failed turns

Office sessions carry the third-party setting flowdrop_office.office = TRUE, which is how the module tells them apart from a user's other sessions on the same workflow.