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

# Manually execute a workflow

> Runs a workflow synchronously through the workflow engine for testing or one-off use. Optional contactId/conversationId scope the run; the response includes the WorkflowExecution record plus a summary of nodes executed and duration.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/workflows/{id}/execute
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/workflows/{id}/execute:
    post:
      tags:
        - Workflows
      summary: Manually execute a workflow
      description: >-
        Runs a workflow synchronously through the workflow engine for testing or
        one-off use. Optional contactId/conversationId scope the run; the
        response includes the WorkflowExecution record plus a summary of nodes
        executed and duration.
      operationId: post_workflows_execute
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowExecuteRequest'
      responses:
        '202':
          description: >-
            Workflow execution queued (runs asynchronously on the
            workflow-runner service)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowExecuteQueuedResponse'
        '500':
          description: Error executing workflow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowsErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    WorkflowExecuteRequest:
      type: object
      description: >-
        Optional scoping for a manual run. Forwarded to the queued job as
        `trigger.contactId` / `trigger.conversationId` so workflow nodes can
        reference an existing contact/conversation.
      properties:
        contactId:
          type: string
          description: >-
            Optional Contact `_id` to bind the run to — workflow nodes can read
            this from the trigger context.
        conversationId:
          type: string
          description: >-
            Optional Conversation `_id` to bind the run to — workflow nodes can
            read this from the trigger context.
      additionalProperties: true
      example:
        contactId: 64b2c3d4e5f60012345678aa
        conversationId: 64d2f9c5e8a1d4e001a0b1c2
    WorkflowExecuteQueuedResponse:
      type: object
      description: >-
        Returned by `POST /api/workflows/{id}/execute`. The handler enqueues a
        BullMQ job; actual execution happens asynchronously on the
        workflow-runner service. Inspect the WorkflowExecution collection by
        `workflowId` to follow the run.
      properties:
        success:
          type: boolean
          enum:
            - true
        message:
          type: string
        queued:
          type: boolean
          enum:
            - true
      required:
        - success
        - message
        - queued
      additionalProperties: true
      example:
        success: true
        message: Workflow execution queued
        queued: true
    WorkflowsErrorResponse:
      type: object
      description: Standard error envelope for Workflows endpoints.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
      required:
        - success
      additionalProperties: true
      example:
        success: false
        message: Workflow not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````