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

# Run a Workflow

> Run a specific workflow by its ID.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json post /orgs/{org_id}/workflows/{workflow_id}/runs
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/workflows/{workflow_id}/runs:
    post:
      tags:
        - Orgs Workflows
      summary: Run a Workflow
      description: Run a specific workflow by its ID.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the org
          name: org_id
          in: path
        - schema:
            type: string
          required: true
          description: The ID of the workflow
          name: workflow_id
          in: path
        - schema:
            type: boolean
          required: false
          name: expand
          in: query
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRunSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateRunSchema'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunSchema'
components:
  schemas:
    CreateRunSchema:
      type: object
      properties:
        input:
          allOf:
            - $ref: '#/components/schemas/InputValuesSchema'
            - description: Values of the fields
        stream:
          type: boolean
          description: >-
            Indicates if the run should stream output to the client as it
            becomes available via SSE (Server-Sent Events)
        background:
          type: boolean
          description: >-
            Indicates if the run should be executed in the background and return
            the run information immediately
        workflow_version_id:
          $ref: '#/components/schemas/WorkflowVersionIdSchema'
        from_step_key:
          type: string
          maxLength: 128
          description: Step key to start the run from
        identifier:
          type: string
          maxLength: 256
          description: >-
            Temporary WebSocket identifier used to track run status before
            creation completes
      description: Data to create a new run
    RunSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the run
        result:
          $ref: '#/components/schemas/RunResultSchema'
        outputs:
          $ref: '#/components/schemas/RunOutputsSchema'
        status:
          $ref: '#/components/schemas/RunStatusSchema'
        origin:
          type: string
          enum:
            - WORKFLOW
            - TRIGGER
            - WEBHOOK
          description: Origin of the run
          example: WORKFLOW
        error:
          type: string
          description: Error message if the run failed
        started_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of when the run started
        ended_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of when the run ended
        org_id:
          type: string
          description: ID of the associated org where the run was triggered from
        workflow_org_id:
          type: string
          description: ID of the associated org where the workflow belongs to
        workflow_id:
          type: string
          description: ID of the associated workflow
        workflow_version_draft:
          type:
            - object
            - 'null'
          properties:
            steps:
              type: array
              items:
                $ref: '#/components/schemas/StepSchema'
              description: Steps of the workflow at the time this version was deployed
          required:
            - steps
          description: Draft version of the workflow
        workflow_version:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              description: Unique identifier for the workflow version
            workflow_id:
              type: string
              description: Workflow id where the version belongs to
            description:
              type:
                - string
                - 'null'
              description: >-
                Description of the workflow at the time this version was
                deployed
            version:
              type: number
              description: Version number
            rollback_version:
              type: number
              description: Version number from which this version was rolled back
            notes:
              type:
                - string
                - 'null'
              description: Release notes
            created_by:
              allOf:
                - $ref: '#/components/schemas/UserPublicSchema'
                - description: User who deployed the version
            created_at:
              type:
                - string
                - 'null'
              format: date-time
              description: Date when the version was deployed
            steps:
              type: array
              items:
                $ref: '#/components/schemas/StepSchema'
              description: Steps of the workflow at the time this version was deployed
          required:
            - id
            - workflow_id
            - description
            - version
            - notes
            - created_at
            - steps
          description: Details of the workflow version used for the run
        version:
          type: number
          description: Version number of the workflow
        usage:
          $ref: '#/components/schemas/CreditsRunUsageSchema'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of when the run was created
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of when the run was last updated
      required:
        - id
        - status
        - origin
        - started_at
        - ended_at
        - org_id
        - workflow_org_id
        - workflow_id
        - workflow_version_draft
        - workflow_version
        - created_at
        - updated_at
    InputValuesSchema:
      type: object
      additionalProperties: {}
      description: >-
        For connection-bound tools, locked input values (e.g. a selected
        resource) that drive dynamic fields and are injected at execution
    WorkflowVersionIdSchema:
      anyOf:
        - type: string
          enum:
            - draft
            - latest
        - type: string
        - type: number
      description: >-
        ID of the workflow version. Use "latest", "draft" or "version number"
        for a specific version
      example: latest
    RunResultSchema:
      description: Result of the run
    RunOutputsSchema:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/StepOutputSchema'
      description: Outputs of all steps in the run
    RunStatusSchema:
      type: string
      enum:
        - PENDING
        - RUNNING
        - CANCELED
        - COMPLETED
        - SKIPPED
        - FAILED
      description: Status of the run
      example: RUNNING
    StepSchema:
      type: object
      description: >-
        A workflow step. `type` selects one of the step types in StepTypeSchema;
        the remaining properties vary by type. Call `GET /metadata/steps` for
        every type with its input fields, localised via `?lang=`.
      properties:
        type:
          $ref: '#/components/schemas/StepTypeSchema'
      required:
        - type
      additionalProperties: true
    UserPublicSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        avatar:
          type:
            - string
            - 'null'
      required:
        - id
        - name
        - avatar
    CreditsRunUsageSchema:
      allOf:
        - $ref: '#/components/schemas/CreditsUsageSchema'
        - type: object
          properties:
            steps:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/CreditsUsageSchema'
          required:
            - steps
      description: Credits usage of the run
    StepOutputSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the output
        type:
          $ref: '#/components/schemas/StepTypeSchema'
        key:
          $ref: '#/components/schemas/StepKeySchema'
        status:
          $ref: '#/components/schemas/StepStatusSchema'
        output:
          description: Output of the step
        index:
          type: number
          description: Index of the step if part of a loop
        start:
          type: number
          description: Timestamp of when the step started
        end:
          type: number
          description: Timestamp of when the step ended
        error:
          type: string
          description: Error message if the step failed
        logs:
          $ref: '#/components/schemas/StepLogsSchema'
        calls:
          type: array
          items:
            description: Sub-calls made by the step
            nullable: false
            oneOf:
              - $ref: '#/components/schemas/StepOutputSchema'
      required:
        - type
        - key
        - status
        - start
      description: Output of the step, including outputs, status and logs
    StepTypeSchema:
      type: string
      enum:
        - note
        - ai
        - code
        - form
        - result
        - branch
        - scheduler:on_schedule
        - workflows:call_workflow
        - tools:http_request
        - tools:web_search
        - tools:web_scraping
        - tools:openapi_request
        - files:download_file
        - files:upload_file
        - files:create_csv
        - files:delete_file
        - files:markdown_to_pdf
        - files:html_to_pdf
        - tables:manage_records
        - tables:create_record
        - tables:update_record
        - tables:delete_record
        - tables:search_records
        - tables:list_tables
        - tables:get_table_schema
        - tables:get_record
        - tables:list_views
        - tables:get_view_items
        - tables:create_table
        - tables:update_table
        - tables:delete_table
        - tables:manage_fields
        - tables:move_field
        - tables:delete_field
        - tables:create_view
        - tables:update_view
        - tables:delete_view
        - tables:duplicate_view
        - tables:move_view_item
        - tables:list_view_groups
        - tables:aggregate_records
        - tables:reorder_views
        - pages:list_pages
        - pages:get_page
        - pages:create_page
        - pages:update_page
        - pages:delete_page
        - pages:create_block
        - pages:update_block
        - pages:move_block
        - pages:delete_block
        - knowledge:search
        - knowledge:get_chunk
        - knowledge:list_contents
        - knowledge:get_content
        - knowledge:get_content_text
        - knowledge:find_in_content
        - knowledge:replace_in_content
        - knowledge:get_stats
        - knowledge:add_content
        - knowledge:update_content
        - knowledge:reindex_content
        - knowledge:delete_content
        - assistants:list
        - assistants:get
        - assistants:create
        - assistants:update
        - assistants:replace
        - assistants:get_models
        - assistants:update_settings
        - assistants:list_knowledge
        - assistants:link_knowledge
        - assistants:unlink_knowledge
        - assistants:list_channels
        - assistants:create_channel
        - assistants:update_channel
        - assistants:delete_channel
        - assistants:list_actions
        - assistants:create_action
        - assistants:update_action
        - assistants:delete_action
        - assistants:set_contact_field
        - assistants:remove_contact_field
        - agents:list
        - agents:get
        - agents:create
        - agents:update
        - agents:list_routines
        - agents:create_routine
        - agents:cancel_routine
        - chats:list
        - chats:get
        - inbox:list_chats
        - inbox:get_messages
        - inbox:reply
        - inbox:assign
        - inbox:set_status
        - inbox:mark_resolved
        - inbox:reopen
        - members:list
        - broadcasts:list
        - broadcasts:get
        - broadcasts:create
        - broadcasts:update
        - broadcasts:duplicate
        - broadcasts:delete
        - broadcasts:set_state
        - broadcasts:set_channel_template
        - broadcasts:add_recipients
        - broadcasts:get_recipient_counts
        - broadcasts:retry_recipients
        - broadcasts:remove_recipients
        - broadcasts:list_fields
        - broadcasts:set_field
        - broadcasts:set_field_entries
        - broadcasts:schedule
        - broadcasts:cancel
        - broadcasts:activate
        - broadcasts:pause
        - broadcasts:send_test
        - broadcasts:get_analytics
        - broadcasts:list_recipients
        - analytics:org_summary
        - analytics:assistants_performance
        - analytics:team_performance
        - analytics:response_times
        - analytics:channels_breakdown
        - analytics:contacts_growth
        - analytics:contacts_by_channel
        - analytics:top_segments
        - analytics:workflows_performance
        - audit:list
        - skills:list
        - skills:get
        - skills:create
        - skills:update
        - skills:replace
        - contacts:search
        - contacts:get
        - contacts:update
        - contacts:delete
        - contacts:merge
        - contacts:update_segments
        - contacts:list_activities
        - contacts:list_comments
        - contacts:add_comment
        - contacts:list_memories
        - contacts:list_files
        - contacts:list_suppressions
        - contacts:add_suppressions
        - contacts:remove_suppressions
        - contacts:import
        - segments:list
        - segments:get
        - segments:create
        - segments:update
        - segments:delete
        - emails:on_email_status_change
        - emails:send_email
        - mcp:tool_call
        - google_sheets:on_spreadsheets_new_row
        - google_sheets:spreadsheets_search
        - google_sheets:spreadsheets_list
        - google_sheets:worksheets_list
        - google_sheets:spreadsheets_append_row
        - google_sheets:spreadsheets_update_row
        - google_calendar:on_new_event
        - google_calendar:calendars_list
        - google_calendar:freebusy_query
        - google_calendar:events_search
        - google_calendar:events_get
        - google_calendar:events_create
        - google_calendar:events_update
        - google_calendar:events_delete
        - google_calendar:events_quick_add
        - outlook_calendar:freebusy_query
        - outlook_calendar:events_search
        - outlook_calendar:events_get
        - outlook_calendar:events_create
        - outlook_calendar:events_update
        - outlook_calendar:events_delete
        - google_drive:files_search
        - google_drive:files_list
        - google_drive:files_get
        - google_drive:files_download
        - google_drive:files_create
        - google_drive:files_update
        - google_drive:files_delete
        - google_drive:folders_create
        - airtable:bases_list
        - airtable:tables_list
        - airtable:records_search
        - airtable:record_get
        - airtable:record_create
        - airtable:record_update
        - airtable:record_delete
        - notion:data_sources_list
        - notion:search
        - notion:records_search
        - notion:record_get
        - notion:record_create
        - notion:record_update
        - notion:pages_search
        - notion:pages_and_records_list
        - notion:page_get
        - notion:page_create
        - notion:page_update
        - notion:page_content_append
        - notion:comments_list
        - notion:comment_create
        - linear:teams_list
        - linear:states_list
        - linear:users_list
        - linear:labels_list
        - linear:issues_search
        - linear:issue_get
        - linear:issue_create
        - linear:issue_update
        - linear:issue_comment_create
        - trello:boards_list
        - trello:board_get
        - trello:lists_list
        - trello:cards_search
        - trello:card_get
        - trello:card_create
        - trello:card_update
        - trello:card_move
        - trello:card_comment
        - trello:card_delete
        - trello:members_list
        - trello:labels_list
        - hubspot:contacts_search
        - hubspot:contact_get
        - hubspot:contact_create
        - hubspot:contact_update
        - hubspot:contact_properties_list
        - hubspot:companies_search
        - hubspot:company_get
        - hubspot:company_create
        - hubspot:company_update
        - hubspot:company_properties_list
        - hubspot:deals_search
        - hubspot:deal_get
        - hubspot:deal_create
        - hubspot:deal_update
        - hubspot:deal_properties_list
        - hubspot:meetings_search
        - hubspot:meeting_get
        - hubspot:meeting_create
        - hubspot:meeting_update
        - hubspot:meeting_delete
        - salesforce:objects_list
        - salesforce:leads_search
        - salesforce:lead_get
        - salesforce:lead_create
        - salesforce:lead_update
        - salesforce:lead_delete
        - salesforce:contacts_search
        - salesforce:contact_get
        - salesforce:contact_create
        - salesforce:contact_update
        - salesforce:contact_delete
        - salesforce:accounts_search
        - salesforce:account_get
        - salesforce:account_create
        - salesforce:account_update
        - salesforce:account_delete
        - salesforce:opportunities_search
        - salesforce:opportunity_get
        - salesforce:opportunity_create
        - salesforce:opportunity_update
        - salesforce:opportunity_delete
        - zoho:modules_list
        - zoho:records_search
        - zoho:record_get
        - zoho:record_create
        - zoho:record_update
        - zoho:record_delete
        - zoho:leads_search
        - zoho:lead_get
        - zoho:lead_create
        - zoho:lead_update
        - zoho:lead_delete
        - zoho:lead_convert
        - zoho:contacts_search
        - zoho:contact_get
        - zoho:contact_create
        - zoho:contact_update
        - zoho:contact_delete
        - zoho:contact_tags_add
        - zoho:contact_tags_remove
        - zoho:accounts_search
        - zoho:account_get
        - zoho:account_create
        - zoho:account_update
        - zoho:account_delete
        - zoho:deals_search
        - zoho:deal_get
        - zoho:deal_create
        - zoho:deal_update
        - zoho:deal_delete
        - zoho:calendar_events_list
        - zoho:calendar_event_create
        - zoho:calendar_event_update
        - zoho:calendar_event_delete
        - zoho:attachments_upload
        - zoho:attachments_list
        - zoho:attachments_download
        - zoho:attachments_delete
        - zoho_bookings:availability_get
        - zoho_bookings:appointments_search
        - zoho_bookings:appointment_get
        - zoho_bookings:appointment_book
        - zoho_bookings:appointment_reschedule
        - zoho_bookings:appointment_update
        - zoho_bookings:appointment_cancel
        - zoho_bookings:customer_create
        - zoho_inventory:items_search
        - zoho_inventory:item_get
        - zoho_inventory:item_create
        - zoho_inventory:item_update
        - zoho_inventory:item_image_upload
        - zoho_inventory:item_image_delete
        - zoho_inventory:contacts_search
        - zoho_inventory:contact_get
        - zoho_inventory:contact_create
        - zoho_inventory:contact_update
        - zoho_inventory:sales_orders_search
        - zoho_inventory:sales_order_get
        - zoho_inventory:sales_order_create
        - zoho_inventory:sales_order_update
        - zoho_inventory:invoices_search
        - zoho_inventory:invoice_get
        - zoho_inventory:invoice_create
        - zoho_inventory:invoice_send
        - zoho_calendar:calendars_list
        - zoho_calendar:freebusy_get
        - zoho_calendar:events_search
        - zoho_calendar:event_get
        - zoho_calendar:event_create
        - zoho_calendar:event_update
        - zoho_calendar:event_delete
        - gohighlevel:contacts_search
        - gohighlevel:contact_get
        - gohighlevel:contact_create
        - gohighlevel:contact_update
        - gohighlevel:contact_delete
        - gohighlevel:contact_tags_add
        - gohighlevel:contact_tags_remove
        - gohighlevel:opportunities_search
        - gohighlevel:opportunity_get
        - gohighlevel:opportunity_create
        - gohighlevel:opportunity_update
        - gohighlevel:opportunity_delete
        - gohighlevel:calendar_free_slots
        - gohighlevel:calendar_blocked_slots
        - gohighlevel:calendar_events_list
        - gohighlevel:calendar_event_create
        - gohighlevel:calendar_event_update
        - gohighlevel:calendar_event_delete
        - cal:slots_get
        - cal:bookings_list
        - cal:booking_get
        - cal:booking_create
        - cal:booking_update
        - cal:booking_cancel
        - calendly:available_times_get
        - calendly:events_search
        - calendly:event_get
        - calendly:event_create
        - calendly:event_cancel
        - calendly:scheduling_link_create
        - slack:on_mention
        - slack:on_channel_new_message
        - slack:search
        - slack:channels_messages_list
        - slack:channels_send_message
        - slack:channels_reply_message
        - telegram:on_new_message
        - telegram:send_message
        - instagram:on_new_message
        - instagram:send_message
        - messenger:on_new_message
        - messenger:send_message
        - tiktok:on_new_message
        - tiktok:send_message
        - whatsapp:on_new_message
        - whatsapp:on_message_status_change
        - whatsapp:send_message
        - whatsapp:send_message_template
        - whatsapp:send_conversion_event
        - whatsapp:get_templates
        - whatsapp:get_template
        - whatsapp:create_template
        - whatsapp:get_template_library
        - whatsapp:create_template_from_library
        - whatsapp:edit_template
        - whatsapp:delete_template
        - gmail:on_new_email
        - gmail:send_email
        - gmail:reply_email
        - gmail:labels_list
        - japifon:on_new_message
        - japifon:message_send
        - smpp:send_message
        - smpp:on_message_status_change
        - twilio:on_new_message
        - twilio:send_message
        - telnyx:on_new_message
        - telnyx:send_message
        - resend:on_new_email
        - resend:send_email
        - stripe:customers_search
        - stripe:customer_get
        - stripe:customer_create
        - stripe:customer_update
        - stripe:checkout_session_create
        - stripe:billing_portal_session_create
        - stripe:currencies_list
        - stripe:prices_list
        - stripe:payment_link_create
        - stripe:payment_link_get
        - stripe:payment_get
        - stripe:payment_refund
        - stripe:payments_list
        - stripe:subscription_create
        - stripe:subscription_get
        - stripe:subscription_update
        - stripe:subscription_cancel
        - stripe:subscriptions_list
        - stripe:invoice_create
        - stripe:invoice_get
        - stripe:invoice_send
        - stripe:invoices_list
        - shopify:products_search
        - shopify:product_get
        - shopify:product_variants_search
        - shopify:orders_search
        - shopify:order_get
        - shopify:order_create
        - shopify:order_update
        - shopify:customers_search
        - shopify:customer_get
        - shopify:customer_create
        - shopify:customer_update
        - shopify:inventory_levels_list
        - zendesk:ticket_search
        - zendesk:ticket_get
        - zendesk:ticket_create
        - zendesk:ticket_update
        - zendesk:ticket_reply
        - zendesk:ticket_add_note
        - zendesk:ticket_comments_list
        - zendesk:tickets_list
        - odoo:leads_search
        - odoo:lead_get
        - odoo:lead_create
        - odoo:lead_update
        - odoo:lead_delete
        - odoo:lead_convert
        - odoo:opportunities_search
        - odoo:opportunity_get
        - odoo:opportunity_create
        - odoo:opportunity_update
        - odoo:opportunity_delete
        - odoo:contacts_search
        - odoo:calendar_events_list
        - odoo:calendar_event_create
        - odoo:calendar_event_update
        - odoo:calendar_event_delete
        - odoo:attachments_upload
        - odoo:attachments_list
        - odoo:attachments_download
        - odoo:attachments_delete
        - woocommerce:products_search
        - woocommerce:product_get
        - woocommerce:product_variations_search
        - woocommerce:customers_search
        - woocommerce:customer_get
        - woocommerce:customer_create
        - woocommerce:customer_update
        - woocommerce:orders_search
        - woocommerce:order_get
        - woocommerce:order_create
        - woocommerce:order_update
        - woocommerce:order_note_create
        - woocommerce:coupon_get
        - woocommerce:product_categories_list
      description: Step type
    CreditsUsageSchema:
      type: object
      properties:
        total:
          type: number
        ai_total:
          type: number
        calls:
          type: array
          items:
            $ref: '#/components/schemas/CreditsCallUsageSchema'
      required:
        - total
        - ai_total
    StepKeySchema:
      type: string
      minLength: 1
      maxLength: 128
      description: Unique identifier for the step, used to connect steps together
    StepStatusSchema:
      type: string
      enum:
        - RUNNING
        - COMPLETED
        - FAILED
        - SKIPPED
        - CANCELED
      description: Status of the step
      example: RUNNING
    StepLogsSchema:
      type: array
      items: {}
      description: Logs generated during the step execution
    CreditsCallUsageSchema:
      type: object
      properties:
        id:
          type: string
        total:
          type: number
        ai_total:
          type: number
        calls:
          type: array
          items:
            type: 'null'
            nullable: false
            oneOf:
              - $ref: '#/components/schemas/CreditsUsageSchema'
      required:
        - id
        - total
        - ai_total
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````