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

# Create a workflow node

> Create a new default workflow node and return it with the latest workflow

Choose where the node goes with `insertMode`:

* `between` places it between an existing `fromNodeId` -> `toNodeId` connection
* `before` places it before `beforeNodeId`.

New nodes start with default settings; update the node after creation to configure it. Branch nodes create their default paths too: `BranchNode` creates two `AudienceFilter` children, and `ExperimentBranchNode` creates two regular `VariantNode` children plus one control `VariantNode`.

Public workflows can have up to 300 nodes. Generated children count toward that limit, so a normal create adds 1 node, `BranchNode` adds 3, and `ExperimentBranchNode` adds 4. To add a new branch or experiment branch, use the `/v1/workflows/{workflowId}/nodes/{nodeId}/add-branch` endpoint instead.


## OpenAPI

````yaml /openapi.json post /v1/workflows/{workflowId}/nodes
openapi: 3.1.0
info:
  title: Loops OpenAPI Spec
  description: This is the OpenAPI Spec for the [Loops API](https://loops.so/docs/api).
  version: 1.20.0
servers:
  - url: https://app.loops.so/api
security: []
tags:
  - name: API key
  - name: Audience segments
    description: View audience segments
  - name: Campaigns
    description: Create and manage email campaigns
  - name: Campaign groups
    description: Organize campaigns into groups
  - name: Components
    description: View email components
  - name: Configuration
    description: View configuration settings
  - name: Contacts
    description: Manage contacts in your audience
  - name: Contact properties
    description: Manage contact properties
  - name: Email messages
    description: Manage email message content for campaigns
  - name: Events
    description: Trigger workflows with events
  - name: Event patterns
    description: View workflow event patterns
  - name: Mailing lists
    description: View mailing lists
  - name: Themes
    description: View email themes
  - name: Transactional emails
    description: Create, manage, and send transactional emails
  - name: Transactional groups
    description: Organize transactional emails into groups
  - name: Uploads
    description: Upload image assets
  - name: Workflows
    description: View and mutate workflow graphs
  - name: Workflow nodes
    description: View and mutate workflow nodes
paths:
  /v1/workflows/{workflowId}/nodes:
    parameters:
      - name: workflowId
        in: path
        required: true
        description: The ID of the workflow.
        schema:
          type: string
    post:
      tags:
        - Workflow nodes
      summary: Create a workflow node
      description: >-
        Create a new default workflow node and return it with the latest
        workflow.


        Choose where the node goes with `insertMode`: `between` places it
        between an existing `fromNodeId` -> `toNodeId` connection, and `before`
        places it before `beforeNodeId`.


        New nodes start with default settings; update the node after creation to
        configure it. Branch nodes create their default paths too: `BranchNode`
        creates two `AudienceFilter` children, and `ExperimentBranchNode`
        creates two regular `VariantNode` children plus one control
        `VariantNode`. Public workflows can have up to 300 nodes. Generated
        children count toward that limit, so a normal create adds 1 node,
        `BranchNode` adds 3, and `ExperimentBranchNode` adds 4. To add a new
        branch or experiment branch, use the
        `/v1/workflows/{workflowId}/nodes/{nodeId}/add-branch` endpoint instead.
      operationId: createWorkflowNode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkflowNodeRequest'
      responses:
        '200':
          description: Workflow node created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWorkflowNodeResponse'
        '400':
          description: Invalid request. Details will be shown in `message`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFailureResponse'
        '401':
          description: Invalid API key or workflow API not enabled for this team.
        '404':
          description: Workflow or workflow node not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFailureResponse'
        '405':
          description: Wrong HTTP request method.
        '409':
          description: '`expectedRevisionId` is stale.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFailureResponse'
      security:
        - apiKey: []
components:
  schemas:
    CreateWorkflowNodeRequest:
      oneOf:
        - $ref: '#/components/schemas/CreateWorkflowNodeBetweenRequest'
        - $ref: '#/components/schemas/CreateWorkflowNodeBeforeRequest'
      description: >-
        Create a new workflow node with an explicit `insertMode`. To configure
        the node after creation, call the update workflow node endpoint.
      discriminator:
        propertyName: insertMode
        mapping:
          between:
            $ref: '#/components/schemas/CreateWorkflowNodeBetweenRequest'
          before:
            $ref: '#/components/schemas/CreateWorkflowNodeBeforeRequest'
    CreateWorkflowNodeResponse:
      type: object
      properties:
        node:
          $ref: '#/components/schemas/CreatedWorkflowNode'
        workflow:
          $ref: '#/components/schemas/SimplifiedWorkflowWithRevision'
      required:
        - node
        - workflow
      additionalProperties: false
    WorkflowFailureResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    CreateWorkflowNodeBetweenRequest:
      type: object
      description: >-
        Insert a new node between two existing nodes, `fromNodeId` and
        `toNodeId`.
      properties:
        expectedRevisionId:
          $ref: '#/components/schemas/WorkflowExpectedRevisionId'
        insertMode:
          type: string
          enum:
            - between
        nodeTypeName:
          $ref: '#/components/schemas/CreateWorkflowNodeTypeName'
        fromNodeId:
          type: string
          description: >-
            The node to insert after. This node must currently point to
            `toNodeId`.
        toNodeId:
          type: string
          description: The node to insert before.
      required:
        - expectedRevisionId
        - insertMode
        - nodeTypeName
        - fromNodeId
        - toNodeId
      additionalProperties: false
    CreateWorkflowNodeBeforeRequest:
      type: object
      description: Insert a new node before `beforeNodeId`.
      properties:
        expectedRevisionId:
          $ref: '#/components/schemas/WorkflowExpectedRevisionId'
        insertMode:
          type: string
          enum:
            - before
        nodeTypeName:
          $ref: '#/components/schemas/CreateWorkflowNodeTypeName'
        beforeNodeId:
          type: string
          description: >-
            The node to insert before. The target must have at least one
            incoming parent and cannot be a trigger node.
      required:
        - expectedRevisionId
        - insertMode
        - nodeTypeName
        - beforeNodeId
      additionalProperties: false
    CreatedWorkflowNode:
      allOf:
        - $ref: '#/components/schemas/WorkflowMutationNodeWithRevision'
        - type: object
          properties:
            createdChildNodes:
              type: array
              description: >-
                Default child nodes created along with the requested node.
                BranchNode creation returns two AudienceFilter children.
                ExperimentBranchNode creation returns two regular VariantNode
                children and one control VariantNode.
              items:
                $ref: '#/components/schemas/WorkflowMutationNode'
    SimplifiedWorkflowWithRevision:
      allOf:
        - $ref: '#/components/schemas/SimplifiedWorkflow'
        - type: object
          properties:
            workflowRevisionId:
              $ref: '#/components/schemas/WorkflowRevisionId'
          required:
            - workflowRevisionId
    WorkflowExpectedRevisionId:
      type: string
      description: >-
        The workflow revision token returned by the latest workflow read or
        mutation. Mutations reject stale values.
    CreateWorkflowNodeTypeName:
      type: string
      enum:
        - AudienceFilter
        - BranchNode
        - ExperimentBranchNode
        - TimerAction
        - SendEmailAction
        - VariantNode
      description: >-
        Node types that can be created with the API. `*Trigger` nodes and
        `ExitAction` nodes cannot be created.
    WorkflowMutationNodeWithRevision:
      description: >-
        Detailed workflow node returned from a mutation, plus the latest
        workflow revision token.
      oneOf:
        - $ref: '#/components/schemas/SignupTriggerWorkflowMutationNodeWithRevision'
        - $ref: '#/components/schemas/EventTriggerWorkflowMutationNodeWithRevision'
        - $ref: >-
            #/components/schemas/ContactPropertyTriggerWorkflowMutationNodeWithRevision
        - $ref: >-
            #/components/schemas/AddToListTriggerWorkflowMutationNodeWithRevision
        - $ref: '#/components/schemas/BlankTriggerWorkflowMutationNodeWithRevision'
        - $ref: '#/components/schemas/AudienceFilterWorkflowMutationNodeWithRevision'
        - $ref: '#/components/schemas/TimerActionWorkflowMutationNodeWithRevision'
        - $ref: '#/components/schemas/SendEmailActionWorkflowMutationNodeWithRevision'
        - $ref: '#/components/schemas/ExitActionWorkflowMutationNodeWithRevision'
        - $ref: '#/components/schemas/BranchWorkflowMutationNodeWithRevision'
        - $ref: >-
            #/components/schemas/ExperimentBranchWorkflowMutationNodeWithRevision
        - $ref: '#/components/schemas/VariantWorkflowMutationNodeWithRevision'
      discriminator:
        propertyName: typeName
        mapping:
          SignupTrigger:
            $ref: '#/components/schemas/SignupTriggerWorkflowMutationNodeWithRevision'
          EventTrigger:
            $ref: '#/components/schemas/EventTriggerWorkflowMutationNodeWithRevision'
          ContactPropertyTrigger:
            $ref: >-
              #/components/schemas/ContactPropertyTriggerWorkflowMutationNodeWithRevision
          AddToListTrigger:
            $ref: >-
              #/components/schemas/AddToListTriggerWorkflowMutationNodeWithRevision
          BlankTrigger:
            $ref: '#/components/schemas/BlankTriggerWorkflowMutationNodeWithRevision'
          AudienceFilter:
            $ref: >-
              #/components/schemas/AudienceFilterWorkflowMutationNodeWithRevision
          TimerAction:
            $ref: '#/components/schemas/TimerActionWorkflowMutationNodeWithRevision'
          SendEmailAction:
            $ref: >-
              #/components/schemas/SendEmailActionWorkflowMutationNodeWithRevision
          ExitAction:
            $ref: '#/components/schemas/ExitActionWorkflowMutationNodeWithRevision'
          BranchNode:
            $ref: '#/components/schemas/BranchWorkflowMutationNodeWithRevision'
          ExperimentBranchNode:
            $ref: >-
              #/components/schemas/ExperimentBranchWorkflowMutationNodeWithRevision
          VariantNode:
            $ref: '#/components/schemas/VariantWorkflowMutationNodeWithRevision'
    WorkflowMutationNode:
      description: >-
        Detailed workflow node returned from create and update mutations. The
        exact fields depend on `typeName`.
      oneOf:
        - $ref: '#/components/schemas/SignupTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/EventTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/ContactPropertyTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/AddToListTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/BlankTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/AudienceFilterWorkflowMutationNode'
        - $ref: '#/components/schemas/TimerActionWorkflowMutationNode'
        - $ref: '#/components/schemas/SendEmailActionWorkflowMutationNode'
        - $ref: '#/components/schemas/ExitActionWorkflowMutationNode'
        - $ref: '#/components/schemas/BranchWorkflowMutationNode'
        - $ref: '#/components/schemas/ExperimentBranchWorkflowMutationNode'
        - $ref: '#/components/schemas/VariantWorkflowMutationNode'
      discriminator:
        propertyName: typeName
        mapping:
          SignupTrigger:
            $ref: '#/components/schemas/SignupTriggerWorkflowMutationNode'
          EventTrigger:
            $ref: '#/components/schemas/EventTriggerWorkflowMutationNode'
          ContactPropertyTrigger:
            $ref: '#/components/schemas/ContactPropertyTriggerWorkflowMutationNode'
          AddToListTrigger:
            $ref: '#/components/schemas/AddToListTriggerWorkflowMutationNode'
          BlankTrigger:
            $ref: '#/components/schemas/BlankTriggerWorkflowMutationNode'
          AudienceFilter:
            $ref: '#/components/schemas/AudienceFilterWorkflowMutationNode'
          TimerAction:
            $ref: '#/components/schemas/TimerActionWorkflowMutationNode'
          SendEmailAction:
            $ref: '#/components/schemas/SendEmailActionWorkflowMutationNode'
          ExitAction:
            $ref: '#/components/schemas/ExitActionWorkflowMutationNode'
          BranchNode:
            $ref: '#/components/schemas/BranchWorkflowMutationNode'
          ExperimentBranchNode:
            $ref: '#/components/schemas/ExperimentBranchWorkflowMutationNode'
          VariantNode:
            $ref: '#/components/schemas/VariantWorkflowMutationNode'
    SimplifiedWorkflow:
      type: object
      properties:
        id:
          type: string
          description: The ID of the workflow.
        status:
          type: string
          enum:
            - Draft
            - Sending
            - Paused
            - PausedAndQueueing
        name:
          type: string
          description: The name of the workflow.
        description:
          type: string
          description: The description of the workflow.
        mailingListId:
          type:
            - string
            - 'null'
          description: The ID of the mailing list the workflow sends to.
        rootNodeId:
          type: string
          description: The ID of the root node in the workflow graph.
        nodes:
          type: object
          description: >-
            A map of node IDs to simplified node objects. Each node includes
            typeName and nextNodeIds, plus type-specific fields when present.
          additionalProperties:
            $ref: '#/components/schemas/SimplifiedWorkflowNode'
      required:
        - id
        - status
        - mailingListId
        - rootNodeId
        - nodes
    WorkflowRevisionId:
      type:
        - string
      description: >-
        The current workflow revision token. Pass the latest value as
        `expectedRevisionId` on the next workflow mutation.
    SignupTriggerWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/SignupTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    EventTriggerWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/EventTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    ContactPropertyTriggerWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/ContactPropertyTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    AddToListTriggerWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/AddToListTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    BlankTriggerWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/BlankTriggerWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    AudienceFilterWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/AudienceFilterWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    TimerActionWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/TimerActionWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    SendEmailActionWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/SendEmailActionWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    ExitActionWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/ExitActionWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    BranchWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/BranchWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    ExperimentBranchWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/ExperimentBranchWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    VariantWorkflowMutationNodeWithRevision:
      allOf:
        - $ref: '#/components/schemas/VariantWorkflowMutationNode'
        - $ref: '#/components/schemas/WorkflowMutationNodeRevision'
    SignupTriggerWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - SignupTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - id
        - typeName
        - nextNodeIds
    EventTriggerWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - EventTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        eventName:
          type: string
          description: The name of the event pattern that triggers this node.
        eventProperties:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowEventProperty'
          description: The properties of the event pattern, which can be used in emails.
        reEligible:
          $ref: '#/components/schemas/WorkflowReEligible'
      required:
        - id
        - typeName
        - nextNodeIds
        - reEligible
    ContactPropertyTriggerWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - ContactPropertyTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        contactPropertyQuery:
          oneOf:
            - $ref: '#/components/schemas/WorkflowContactPropertyQuery'
            - type: 'null'
        reEligible:
          $ref: '#/components/schemas/WorkflowReEligible'
      required:
        - id
        - typeName
        - nextNodeIds
        - contactPropertyQuery
        - reEligible
    AddToListTriggerWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - AddToListTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        mailingListId:
          type:
            - string
            - 'null'
          description: The ID of the mailing list this trigger sends to, if set.
        reEligible:
          $ref: '#/components/schemas/WorkflowReEligible'
      required:
        - id
        - typeName
        - nextNodeIds
        - mailingListId
        - reEligible
    BlankTriggerWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - BlankTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - id
        - typeName
        - nextNodeIds
    AudienceFilterWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - AudienceFilter
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        audienceFilter:
          $ref: '#/components/schemas/AudienceFilter'
        audienceSegmentId:
          type: string
          description: The ID of the audience segment this trigger targets.
        appliesDownstream:
          description: >-
            If `true`, the audience filter will apply to all downstream nodes.
            If `false`, the audience filter will only apply to the current node.
            Matches the "Filter scope" option in the UI.
          type: boolean
      required:
        - id
        - typeName
        - nextNodeIds
        - appliesDownstream
    TimerActionWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - TimerAction
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        amount:
          $ref: '#/components/schemas/WorkflowTimerAmount'
        unit:
          $ref: '#/components/schemas/WorkflowTimerUnit'
      required:
        - id
        - typeName
        - nextNodeIds
        - amount
        - unit
    SendEmailActionWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - SendEmailAction
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        emailMessageId:
          type: string
          description: >-
            The ID of the email message to send. To edit this email, use the
            `POST /v1/email-messages/{emailMessageId}` endpoint.
        subject:
          type: string
      required:
        - id
        - typeName
        - nextNodeIds
        - emailMessageId
        - subject
    ExitActionWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - ExitAction
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - id
        - typeName
        - nextNodeIds
    BranchWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - BranchNode
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - id
        - typeName
        - nextNodeIds
    ExperimentBranchWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - ExperimentBranchNode
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        samplingRate:
          type: number
          description: >-
            The percentage of contacts that will be sent to variant branches,
            between `0` and `100`. The remaining percentage will be sent to the
            control branch. `100` sends all contacts to variant branches.
      required:
        - id
        - typeName
        - nextNodeIds
        - samplingRate
    VariantWorkflowMutationNode:
      type: object
      properties:
        id:
          type: string
        typeName:
          type: string
          enum:
            - VariantNode
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        isControl:
          type: boolean
          description: Whether this is the control variant of an experiment.
      required:
        - id
        - typeName
        - nextNodeIds
    SimplifiedWorkflowNode:
      oneOf:
        - $ref: '#/components/schemas/SimplifiedSignupTriggerWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedEventTriggerWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedContactPropertyTriggerWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedAddToListTriggerWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedBlankTriggerWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedAudienceFilterWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedTimerActionWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedSendEmailActionWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedExitActionWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedBranchWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedExperimentBranchWorkflowNode'
        - $ref: '#/components/schemas/SimplifiedVariantWorkflowNode'
      discriminator:
        propertyName: typeName
        mapping:
          SignupTrigger:
            $ref: '#/components/schemas/SimplifiedSignupTriggerWorkflowNode'
          EventTrigger:
            $ref: '#/components/schemas/SimplifiedEventTriggerWorkflowNode'
          ContactPropertyTrigger:
            $ref: '#/components/schemas/SimplifiedContactPropertyTriggerWorkflowNode'
          AddToListTrigger:
            $ref: '#/components/schemas/SimplifiedAddToListTriggerWorkflowNode'
          BlankTrigger:
            $ref: '#/components/schemas/SimplifiedBlankTriggerWorkflowNode'
          AudienceFilter:
            $ref: '#/components/schemas/SimplifiedAudienceFilterWorkflowNode'
          TimerAction:
            $ref: '#/components/schemas/SimplifiedTimerActionWorkflowNode'
          SendEmailAction:
            $ref: '#/components/schemas/SimplifiedSendEmailActionWorkflowNode'
          ExitAction:
            $ref: '#/components/schemas/SimplifiedExitActionWorkflowNode'
          BranchNode:
            $ref: '#/components/schemas/SimplifiedBranchWorkflowNode'
          ExperimentBranchNode:
            $ref: '#/components/schemas/SimplifiedExperimentBranchWorkflowNode'
          VariantNode:
            $ref: '#/components/schemas/SimplifiedVariantWorkflowNode'
    WorkflowMutationNodeRevision:
      type: object
      properties:
        workflowRevisionId:
          $ref: '#/components/schemas/WorkflowRevisionId'
      required:
        - workflowRevisionId
    WorkflowNextNodeIds:
      type: array
      items:
        type: string
      description: The IDs of the nodes that are downstream of this node.
    WorkflowEventProperty:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - date
      required:
        - name
        - type
    WorkflowReEligible:
      type: boolean
      description: >-
        If `true`, the contacts will be able to enter this workflow every time
        the trigger is matched. If `false`, contacts will only ever enter this
        workflow once. Matches the "Trigger frequency" option in the UI.
    WorkflowContactPropertyQuery:
      type: object
      description: >-
        Define the contact property change that triggers the workflow. In update
        requests, `key` must resolve to an existing contact property that is
        available for Contact Updated triggers. Hidden or unsupported fields,
        such as `createdAt`, `notes`, and computed contact properties, are
        rejected.
      properties:
        key:
          type: string
          description: >-
            The camel-cased `key` of the contact property to query. The property
            must exist for the team and must be available for Contact Updated
            triggers.
          examples:
            - firstName
            - email
            - planName
        is:
          $ref: '#/components/schemas/WorkflowContactPropertyComparison'
          description: Comparison for the new contact property value after the update.
        was:
          $ref: '#/components/schemas/WorkflowContactPropertyComparison'
          description: >-
            Comparison for the previous contact property value before the
            update.
      required:
        - key
        - is
        - was
    AudienceFilter:
      type:
        - object
        - 'null'
      description: >-
        A tree of audience conditions combined with `match`. Null when the
        campaign targets a mailing list or segment without an explicit filter.
      properties:
        match:
          type: string
          enum:
            - all
            - any
        conditions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/AudienceFilterCondition'
      required:
        - match
        - conditions
      additionalProperties: false
    WorkflowTimerAmount:
      type: number
      description: >-
        The amount of time to wait before triggering the next node. Set to `0`
        to move to the next node immediately.
    WorkflowTimerUnit:
      type: string
      enum:
        - m
        - h
        - d
      description: >-
        The unit of time for the timer action node. m = minutes, h = hours, d =
        days.
    SimplifiedSignupTriggerWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - SignupTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - typeName
        - nextNodeIds
      additionalProperties: false
    SimplifiedEventTriggerWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - EventTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        eventName:
          type:
            - string
            - 'null'
          description: The name of the event that triggers the workflow.
        reEligible:
          $ref: '#/components/schemas/WorkflowReEligible'
      required:
        - typeName
        - nextNodeIds
        - eventName
        - reEligible
      additionalProperties: false
    SimplifiedContactPropertyTriggerWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - ContactPropertyTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        contactPropertyQuery:
          oneOf:
            - $ref: '#/components/schemas/WorkflowContactPropertyQuery'
            - type: 'null'
        reEligible:
          $ref: '#/components/schemas/WorkflowReEligible'
      required:
        - typeName
        - nextNodeIds
        - contactPropertyQuery
        - reEligible
      additionalProperties: false
    SimplifiedAddToListTriggerWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - AddToListTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        mailingListId:
          type:
            - string
            - 'null'
          description: The ID of the mailing list that triggers the workflow.
        reEligible:
          $ref: '#/components/schemas/WorkflowReEligible'
      required:
        - typeName
        - nextNodeIds
        - mailingListId
        - reEligible
      additionalProperties: false
    SimplifiedBlankTriggerWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - BlankTrigger
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - typeName
        - nextNodeIds
      additionalProperties: false
    SimplifiedAudienceFilterWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - AudienceFilter
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - typeName
        - nextNodeIds
      additionalProperties: false
    SimplifiedTimerActionWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - TimerAction
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        amount:
          $ref: '#/components/schemas/WorkflowTimerAmount'
        unit:
          $ref: '#/components/schemas/WorkflowTimerUnit'
      required:
        - typeName
        - nextNodeIds
        - amount
        - unit
      additionalProperties: false
    SimplifiedSendEmailActionWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - SendEmailAction
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        emailMessageId:
          type:
            - string
            - 'null'
          description: >-
            The ID of the email message to send. To edit this email, use the
            `POST /v1/email-messages/{emailMessageId}` endpoint.
        subject:
          type: string
          description: The subject of the email message (reference only).
      required:
        - typeName
        - nextNodeIds
        - emailMessageId
        - subject
      additionalProperties: false
    SimplifiedExitActionWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - ExitAction
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - typeName
        - nextNodeIds
      additionalProperties: false
    SimplifiedBranchWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - BranchNode
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
      required:
        - typeName
        - nextNodeIds
      additionalProperties: false
    SimplifiedExperimentBranchWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - ExperimentBranchNode
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        samplingRate:
          type: number
          description: >-
            The percentage of contacts that will be sent to variant branches,
            between `0` and `100`. The remaining percentage will be sent to the
            control branch.
      required:
        - typeName
        - nextNodeIds
        - samplingRate
      additionalProperties: false
    SimplifiedVariantWorkflowNode:
      type: object
      properties:
        typeName:
          type: string
          enum:
            - VariantNode
        nextNodeIds:
          $ref: '#/components/schemas/WorkflowNextNodeIds'
        isControl:
          type: boolean
          description: Whether this is the control variant of an experiment.
      required:
        - typeName
        - nextNodeIds
        - isControl
      additionalProperties: false
    WorkflowContactPropertyComparison:
      type: object
      description: >-
        For Contact Updated triggers, the API validates `operator` against the
        selected contact property's type and the side of the comparison. The
        `was` comparison can use any operator supported by the selected property
        type. The `is` comparison uses the same operators, except number and
        boolean properties cannot use `empty`. String properties support `any`,
        `equal`, `not_equal`, `contains`, `not_contains`, `empty`, and
        `not_empty`. Number properties support `any`, `greater_than`,
        `less_than`, `numeric_equal`, `numeric_not_equal`, `empty`, and
        `not_empty`. Boolean properties support `any`, `true`, `false`, `empty`,
        and `not_empty`. Date properties support `any`, `empty`, `not_empty`,
        `after`, `before`, and `between`.
      properties:
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
        operator:
          type: string
          description: >-
            The comparison operator. It must be valid for the selected contact
            property's type and for the `is` or `was` side of the comparison.
            Number and boolean properties allow `empty` on `was`, but not on
            `is`.
          enum:
            - any
            - contains
            - not_contains
            - empty
            - not_empty
            - equal
            - not_equal
            - greater_than
            - less_than
            - 'true'
            - 'false'
            - numeric_equal
            - numeric_not_equal
            - after
            - before
            - between
      required:
        - value
        - operator
    AudienceFilterCondition:
      oneOf:
        - $ref: '#/components/schemas/PropertyCondition'
        - $ref: '#/components/schemas/OptInCondition'
        - $ref: '#/components/schemas/ActivityCondition'
      discriminator:
        propertyName: type
    PropertyCondition:
      type: object
      description: Matches contacts by a property value.
      properties:
        type:
          type: string
          enum:
            - property
        key:
          type: string
          description: The contact property name.
        operator:
          type: string
          enum:
            - any
            - contains
            - notContains
            - equals
            - notEquals
            - greaterThan
            - lessThan
            - isTrue
            - isFalse
            - empty
            - notEmpty
            - dateEmpty
            - dateNotEmpty
            - after
            - before
            - between
        value:
          description: >-
            The comparison value. Omitted for value-less operators (e.g.
            `isTrue`, `empty`). A `{ from, to }` object for `between`.
          oneOf:
            - type: string
            - type: number
            - type: object
              properties:
                from:
                  type: string
                  format: date-time
                to:
                  type: string
                  format: date-time
              required:
                - from
                - to
      required:
        - type
        - key
        - operator
    OptInCondition:
      type: object
      description: Matches contacts by mailing-list opt-in status.
      properties:
        type:
          type: string
          enum:
            - optIn
        status:
          type:
            - string
            - 'null'
          enum:
            - accepted
            - pending
            - rejected
            - null
      required:
        - type
        - status
    ActivityCondition:
      type: object
      description: Matches contacts by their activity on a campaign or workflow.
      properties:
        type:
          type: string
          enum:
            - activity
        action:
          type: string
          enum:
            - sent
            - opened
            - clicked
        negate:
          type: boolean
        target:
          type: string
          enum:
            - campaign
            - workflow
            - workflowEmail
        id:
          type: string
          description: The ID of the campaign, workflow, or workflow email.
      required:
        - type
        - action
        - negate
        - target
        - id
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````