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

# [Beta] Dry-run a workflow against a synthetic payload

> Run the latest version of a workflow once against a synthetic trigger payload, isolated as a test run.



## OpenAPI

````yaml post /workflows/{workflow_id}/test
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /workflows/{workflow_id}/test:
    post:
      tags:
        - Workflows (Beta)
      summary: '[Beta] Dry-run a workflow against a synthetic payload'
      description: >-
        Run the latest version of a workflow once against a synthetic trigger
        payload, isolated as a test run. Call this after validateWorkflow and
        before activateWorkflow to confirm the workflow behaves as expected.
        Returns the new run id — feed it into getWorkflowRun /
        getWorkflowRunSteps to inspect the result. WARNING: "test" means
        synthetic payload, not "no side effects". Actions that send webhooks,
        post Slack messages, write to integrations, or mutate tickets WILL fire
        for real. Scope to a test entity or disable destination integrations
        before calling on a workflow with destructive steps.
      operationId: testWorkflow
      parameters:
        - schema:
            type: string
          in: path
          name: workflow_id
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestWorkflowPublicInput'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWorkflowPublicOutput'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    TestWorkflowPublicInput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/TestWorkflowPublicInputInput'
      type: object
      properties:
        trigger_payload:
          type: object
          properties:
            type:
              type: string
              enum:
                - ivr-incoming-call
                - manual-trigger
                - ai-trigger
                - cron-trigger
                - form-trigger
                - webhook
                - contact-created
                - contact-updated
                - phone-call-started
                - phone-call-finished
                - ticket-created
                - sub-session-created
                - ticket-reassigned
                - ticket-resolved
                - ticket-handoff
                - pre-ticket-handoff
                - ticket-tag-added
                - ticket-inactive
                - agent-inactive
                - csat-score-submit
                - prohibited-topic-detected
                - sla-first-reply-breached
                - sla-next-reply-breached
                - sla-resolution-breached
                - voice-call-transferred
                - pre-voice-call-transfer
                - pre-phone-call-finished
                - manual-ticket-trigger
                - contact-message-received
                - first-contact-message-received
                - macro-called
                - macro-option-clicked
                - ai-response-completed
                - agent-availability-changed
                - agent-avail-in-team-changed
                - ai-response-requested
                - ticket-reopened
                - agent-mentioned
                - agent-message-posted
                - ticket-team-changed
                - session-updated
                - sequence-contact-replied
                - sequence-contact-completed
                - sequence-contact-parked
                - sequence-step-failed
                - sequence-contact-suppressed
              description: >-
                Trigger type whose payload shape this synthetic payload should
                match
            payload: {}
          required:
            - type
            - payload
          description: Synthetic trigger event to dry-run the workflow against
      required:
        - trigger_payload
    TestWorkflowPublicOutput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/TestWorkflowPublicOutput'
      type: object
      properties:
        run_id:
          type: string
          description: >-
            UUID of the test run — feed into
            /workflows/:workflow_id/runs/:run_id
      required:
        - run_id
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.