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

# Add a trigger

> Adds a trigger to the workflow. With `replace: true` it replaces all of the workflow's triggers instead. A trigger added to a Live workflow starts firing straight away. Needs edit access.




## OpenAPI

````yaml /openapi/automations.yaml post /workflows/{workflowId}/subscriptions
openapi: 3.1.0
info:
  title: Connie Automations API
  version: 1.0.0
  description: >
    Endpoints the Connie web app uses for automations. They authenticate with
    your signed-in browser session — see
    https://docs.connie.ai/api-reference/authentication. These are the app's own
    endpoints and can change when the app changes.
servers:
  - url: https://connie.ai/api
security:
  - sessionCookie: []
tags:
  - name: Workflows
    description: List, create, read, update and delete workflows.
  - name: Runs
    description: >-
      Start, retry and stop workflow runs, switch a workflow Live, and read run
      counts.
  - name: Triggers
    description: A workflow's triggers and its schedule settings.
  - name: Templates
    description: The template gallery and copying a template into a workspace.
  - name: Agents
    description: Agents on the Agents page.
paths:
  /workflows/{workflowId}/subscriptions:
    parameters:
      - $ref: '#/components/parameters/workflowId'
    post:
      tags:
        - Triggers
      summary: Add a trigger
      description: >
        Adds a trigger to the workflow. With `replace: true` it replaces all of
        the workflow's triggers instead. A trigger added to a Live workflow
        starts firing straight away. Needs edit access.
      operationId: addWorkflowTrigger
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - triggerId
              properties:
                triggerId:
                  type: string
                  description: >-
                    The trigger type, for example `manual`, `scheduled` or
                    `source_table`.
                accountId:
                  type:
                    - string
                    - 'null'
                  description: >-
                    The connected account the trigger listens on, for triggers
                    that need one.
                filterConfig:
                  type: object
                  additionalProperties: true
                  description: >-
                    The trigger's settings. For `manual`, this holds the run
                    form.
                replace:
                  type: boolean
                  default: false
      responses:
        '200':
          description: The trigger was added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerSubscriptionResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    workflowId:
      name: workflowId
      in: path
      required: true
      description: >-
        The workflow's id, as in
        `https://connie.ai/<workspace-id>/workflows/<workflow-id>`.
      schema:
        type: string
        format: uuid
  schemas:
    TriggerSubscriptionResult:
      type: object
      properties:
        subscription:
          $ref: '#/components/schemas/TriggerSubscription'
        triggerDef:
          type:
            - object
            - 'null'
          additionalProperties: true
        webhookUrl:
          type:
            - string
            - 'null'
    TriggerSubscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workflow_id:
          type: string
          format: uuid
        trigger_id:
          type: string
          description: The trigger type.
        identifier:
          type:
            - string
            - 'null'
          description: The connected account the trigger listens on.
        filter_config:
          type: object
          additionalProperties: true
        is_active:
          type: boolean
          description: Whether the trigger is currently firing.
        triggerDef:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: >-
            The trigger type's definition (name, description, settings it
            takes).
        webhookUrl:
          type:
            - string
            - 'null'
          description: >-
            For a Custom Webhook trigger, the URL that starts the workflow.
            Anyone with it can start the workflow.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Machine-readable code, when there is one.
        details:
          description: Extra detail, for example the invalid fields.
      required:
        - error
  responses:
    BadRequest:
      description: The request is invalid (code `VALIDATION_ERROR`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Not signed in (`UNAUTHORIZED`), or the session cookie has expired
        (`SESSION_EXPIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        You aren't a member of the workspace, or don't have the access this
        needs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found, or not visible to you.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: header
      name: Cookie
      description: >-
        The full Cookie header copied from a signed-in connie.ai browser
        request. See the Authentication page.

````

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