> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmodus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute a workflow action

> Executes a single workflow action step and streams the result as Server-Sent Events. Same idempotency and resume semantics as POST /agent/v1/runs: a retry with the same Idempotency-Key and body resumes the existing stream.

**Requires:** `workflows:invoke`



## OpenAPI

````yaml https://api.getmodus.com/openapi.json post /agent/v1/workflow-actions
openapi: 3.0.3
info:
  title: Modus Public API
  version: 1.0.0
servers: []
security:
  - bearerAuth: []
tags:
  - name: Scopes
    description: Create, configure, deploy, and manage scopes.
  - name: Scopes · Conversations
    description: Read scope conversation threads.
  - name: Scopes · Supervision
    description: Scope supervision sub-resource.
  - name: Scopes · Memories
    description: Long-term memory stored per scope.
  - name: Scopes · Chat
    description: Chat with a published scope.
  - name: Scopes · Context
    description: Compose a scope’s context without an LLM call.
  - name: Modus · Chat
    description: Chat with Modus — your org-wide assistant.
  - name: Modus · Conversations
    description: Read Modus and cross-scope conversation threads.
  - name: Modus · Context
    description: Compose full-environment context without an LLM call.
  - name: Workflows
    description: Create, configure, deploy, and manage workflows.
  - name: Workflows · Runs
    description: Inspect workflow run history.
  - name: Workflows · Interfaces
    description: Slack / MCP / Teams interface management.
  - name: Connections
    description: Read connected integrations.
  - name: Tools
    description: Catalog of tools/integrations a scope can select in its toolset.
  - name: Suggestions
    description: Approved suggested questions and first-party suggestion usage events.
  - name: Context
    description: Create and manage organization context items.
  - name: Usage
    description: Organization LLM usage reporting.
  - name: Users
    description: Organization and membership management.
  - name: Runs · Streaming
    description: 'Run lifecycle: stream, poll, resume, interrupt, and cancel executions.'
  - name: Scopes · Runs
    description: Run a published or draft scope.
  - name: Modus · Runs
    description: Run the Modus home agent.
paths:
  /agent/v1/workflow-actions:
    post:
      tags:
        - Runs · Streaming
      summary: Execute a workflow action
      description: >-
        Executes a single workflow action step and streams the result as
        Server-Sent Events. Same idempotency and resume semantics as POST
        /agent/v1/runs: a retry with the same Idempotency-Key and body resumes
        the existing stream.


        **Requires:** `workflows:invoke`
      operationId: WorkflowActionsController_execute
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Client-generated idempotency key (UUID recommended). Retry with same
            key + same body resumes the existing SSE stream. Same key +
            different body returns a 409 error event.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowActionDto'
      responses:
        '200':
          description: >-
            SSE stream of workflow action run events. Same frame format as POST
            /agent/runs. Ends with a terminal RunEvent (done/error/cancelled).
          content:
            text/event-stream:
              schema:
                type: string
                description: |-
                  W3C Server-Sent Events stream. Each frame:
                    id: <redis-stream-id>\n  data: <json-encoded RunEvent>\n\n

                  RunEvent shapes are identical to POST /agent/runs.
              example: |+
                id: 1717000000000-0
                data: {"type":"token","content":"Result: 42"}

                id: 1717000000001-0
                data: {"type":"done","runId":"xyz-456"}

      security:
        - bearerAuth: []
      servers:
        - url: https://agent.getmodus.com
components:
  schemas:
    WorkflowActionDto:
      type: object
      properties:
        organizationId:
          type: string
          description: >-
            Organization the run belongs to. Omit for PAT/SDK callers — falls
            back to the authenticated principal's org.
        sessionId:
          type: string
          description: Client-generated session identifier.
        fileThreadId:
          type: string
          description: File thread ID for document-scoped execution.
        workflowAction:
          type: object
          description: >-
            Workflow action descriptor: toolId, toolName, aiDescription,
            runtimeScope, and any action-specific parameters.
          additionalProperties: true
        previousOutputs:
          type: array
          description: >-
            Outputs from earlier steps in a multi-step workflow, forwarded to
            the action runtime.
          items:
            type: object
            additionalProperties: true
        userTimezone:
          type: string
          description: >-
            IANA time zone name for the executing user (e.g.
            "America/New_York").
        runId:
          type: string
          description: >-
            Optional client-supplied run ID. Idempotency-Key header takes
            precedence.
        automationId:
          type: string
          description: Workflow id for usage attribution.
        source:
          description: UI surface that triggered this action.
          allOf:
            - $ref: '#/components/schemas/WorkflowActionSource'
      required:
        - sessionId
        - workflowAction
    WorkflowActionSource:
      type: string
      enum:
        - agent
        - api
        - other
      description: UI surface that triggered this action.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      bearerFormat: Modus PAT (modus_<orgUuid>_<prefix>_<secret>) or OAuth 2.1 access token
      type: http
      description: >-
        A Modus personal access token (`modus_<orgUuid>_<prefix>_<secret>`) or
        an OAuth 2.1 access token, sent as `Authorization: Bearer <token>`.

````