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

# Create a workflow trigger

> Create a trigger that fires when the source workflow emits an event.
The target must share the source ownership scope (same team for team
workflows, or the same user for personal workflows) and must not be a
realtime workflow. Superadmins are subject to the same scope check on
the public endpoint.




## OpenAPI

````yaml post /v4/workflows/{workflowId}/triggers
openapi: 3.0.3
info:
  title: Kadoa API
  version: 3.0.0
  contact:
    name: Support
    email: support@kadoa.com
servers:
  - url: https://api.kadoa.com
security: []
paths:
  /v4/workflows/{workflowId}/triggers:
    post:
      tags:
        - Workflow Triggers
      summary: Create a workflow trigger
      description: |
        Create a trigger that fires when the source workflow emits an event.
        The target must share the source ownership scope (same team for team
        workflows, or the same user for personal workflows) and must not be a
        realtime workflow. Superadmins are subject to the same scope check on
        the public endpoint.
      parameters:
        - name: workflowId
          in: path
          required: true
          description: ID of the source workflow
          schema:
            type: string
        - name: x-api-key
          in: header
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - targetWorkflowId
                - eventType
              properties:
                targetWorkflowId:
                  type: string
                  description: ID of the workflow to trigger
                eventType:
                  type: string
                  enum:
                    - workflow_started
                    - workflow_finished
                    - workflow_export_completed
                    - workflow_failed
                    - workflow_recovered
                    - workflow_sample_finished
                    - workflow_data_change
                    - workflow_validation_anomaly_change
                    - workflow_health_degraded
                  description: Event type that triggers the target workflow
                enabled:
                  type: boolean
                  default: true
                  description: Whether the trigger is enabled
      responses:
        '201':
          description: Trigger created successfully
        '400':
          description: >-
            Invalid input, target is a realtime workflow, or the workflow would
            trigger itself
        '401':
          description: Unauthorized
        '403':
          description: >-
            No access to target workflow, or target is outside the source
            ownership scope
        '404':
          description: Workflow not found
        '409':
          description: Duplicate trigger, or source/target ownership is moving teams
        '422':
          description: Source workflow already has the maximum number of triggers (5)
        '500':
          description: Internal server error
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token for authentication

````