> ## 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.

# Validate and dry-run a single workflow node definition

> Per-node dry-run endpoint used by the workflow builder when an author clicks "Test" on a node. The supplied `config` is parsed against the node's `configSchema`; on validation failure the response is HTTP 200 with `success:false` and a Zod-style `issues[]` array so the UI can render field-level errors (4xx is intentionally avoided because the client wrapper throws on 4xx and strips the issues payload). On success: trigger-category nodes are executed against a synthesized `ExecutionContext` built from `input` (so the response reflects the actual trigger output a workflow would see) and side-effecting nodes return a mocked output derived from `outputShape` (real execution is deferred until per-executor dryRun guards land). Special case: `WebhookTrigger` simulates the HTTP-boundary validation done by `/api/webhook/workflow` and surfaces the same `webhookId` checks the real evaluator would apply.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/workflows/nodes/{type}/test
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/nodes/{type}/test:
    post:
      tags:
        - Workflows
      summary: Validate and dry-run a single workflow node definition
      description: >-
        Per-node dry-run endpoint used by the workflow builder when an author
        clicks "Test" on a node. The supplied `config` is parsed against the
        node's `configSchema`; on validation failure the response is HTTP 200
        with `success:false` and a Zod-style `issues[]` array so the UI can
        render field-level errors (4xx is intentionally avoided because the
        client wrapper throws on 4xx and strips the issues payload). On success:
        trigger-category nodes are executed against a synthesized
        `ExecutionContext` built from `input` (so the response reflects the
        actual trigger output a workflow would see) and side-effecting nodes
        return a mocked output derived from `outputShape` (real execution is
        deferred until per-executor dryRun guards land). Special case:
        `WebhookTrigger` simulates the HTTP-boundary validation done by
        `/api/webhook/workflow` and surfaces the same `webhookId` checks the
        real evaluator would apply.
      operationId: post_workflows_nodes_type_test
      parameters:
        - in: path
          name: type
          required: true
          description: >-
            Registered node type (e.g. `WebhookTrigger`, `SendMessage`,
            `IfCondition`).
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowNodeTestRequest'
      responses:
        '200':
          description: >-
            Test executed (success, mocked output, or validation failure).
            Inspect `success` to disambiguate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowNodeTestResponse'
        '404':
          description: Unknown node type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowsErrorResponse'
        '500':
          description: Unhandled error executing the test
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowsErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    WorkflowNodeTestRequest:
      type: object
      description: >-
        `config` is parsed against the node's `configSchema`. `input` is only
        consumed by trigger-category nodes; for non-trigger nodes it is ignored
        and a mocked `outputShape` is returned. Trigger nodes receive `input`
        flattened into an `ExecutionContext` (so fields like `contactId`,
        `messageId`, `from`/`to`/`subject` are read from the top level).
      properties:
        config:
          description: Node-specific configuration to validate.
        input:
          description: Trigger input payload. Ignored for non-trigger nodes.
      additionalProperties: true
      example:
        config:
          webhookId: wh_64d2f9c5e8a1d4e001a0b1c3
        input:
          webhookId: wh_64d2f9c5e8a1d4e001a0b1c3
          payload:
            lead:
              name: Alex Nguyen
              email: alex.nguyen@example.com
    WorkflowNodeTestResponse:
      type: object
      description: >-
        Always 200 OK. Inspect `success` to disambiguate: `true` → trigger
        executed or non-trigger returned a mocked `outputShape`; `false` →
        config validation failed (issues array populated) OR `WebhookTrigger`
        boundary-check failed.
      properties:
        success:
          type: boolean
        output:
          description: >-
            Real trigger output, or mocked `outputShape` keys tagged with their
            declared type for side-effecting nodes.
          type: object
          additionalProperties: true
        message:
          type: string
        issues:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowNodeTestIssue'
        durationMs:
          type: integer
      required:
        - success
        - durationMs
      additionalProperties: true
      example:
        success: true
        output:
          webhookId: wh_64d2f9c5e8a1d4e001a0b1c3
          payload:
            lead:
              name: Alex Nguyen
              email: alex.nguyen@example.com
        durationMs: 4
    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
    WorkflowNodeTestIssue:
      type: object
      description: One entry from a Zod `safeParse` error (`config` failed validation).
      properties:
        code:
          type: string
        path:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
        message:
          type: string
      required:
        - code
        - message
      additionalProperties: true
      example:
        code: invalid_type
        path:
          - webhookId
        message: Required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````