Workflow nodes

Add a branch and a child node under an existing Branch or Experiment node. Returns the created child node plus the latest workflow.

  • Adding a branch to a BranchNode creates one AudienceFilter child node.
  • Adding a branch to an ExperimentBranchNode creates one VariantNode child node.

This endpoint does not accept node configuration fields; update the child node with POST /v1/workflows/{workflowId}/nodes/{nodeId} after creation. Public workflows are limited to 400 nodes, and this endpoint adds 1 node.

post/v1/workflows/{workflowId}/nodes/{nodeId}/add-branch

Request

  • Base URL
    https://app.loops.so/api
  • Auth
    HTTP bearer

Request body

expectedRevisionIdstring nullable required

The workflow revision token returned by the latest workflow read or mutation. Older workflows may return null before their first revision-aware mutation; pass null back as expectedRevisionId in that case. If the token is stale, the API returns a 409 Conflict error.

Response

Branch added.

Example response

{
  "node": {
    "contactPropertyQuery": {
      "key": "firstName"
    }
  },
  "workflow": {
    "id": "clw1a3b5c7d9e1f3g5h7i9j1",
    "url": "https://app.loops.so/workflows/clw1a3b5c7d9e1f3g5h7i9j1",
    "workflowRevisionId": "clx7a3b5c7d9e1f3g5h7i9j2",
    "status": "Draft",
    "name": "Welcome series",
    "description": "Onboarding emails for new signups",
    "workflowGroupId": "clg7n5p3q1r9s7t5u3v1w9y7",
    "mailingListId": "clm2k8j4h6g0f8d6s4a2b0z8",
    "rootNodeId": "cln8p0q2r4s6t8u0v2w4x6z8",
    "nodes": {
      "cln8p0q2r4s6t8u0v2w4x6z8": {
        "typeName": "SignupTrigger",
        "nextNodeIds": [
          "cln1a3b5c7d9e1f3g5h7i9j1"
        ]
      },
      "cln1a3b5c7d9e1f3g5h7i9j1": {
        "typeName": "SendEmailAction",
        "nextNodeIds": [],
        "emailMessageId": "cle5f7g9h1i3j5k7l9m1n3p5",
        "subject": "Welcome to Acme!"
      }
    }
  }
}

Changes

    • info

      added the required property / to the response with the status

    • breaking

      added subschema #1: String subschema #2: Number subschema #3: Boolean to the /////////////// response property oneOf list for the response status

    • breaking

      added subschema #1: String subschema #2: Number subschema #3: Boolean to the /////////////// response property oneOf list for the response status

    • breaking

      added subschema #1: String subschema #2: Number subschema #3: Boolean to the ///////////// response property oneOf list for the response status

    • breaking

      added subschema #1: String subschema #2: Number subschema #3: Boolean to the ///////////// response property oneOf list for the response status

    • breaking

      added subschema #1: String subschema #2: Number subschema #3: Date range to the //////////////// response property oneOf list for the response status

    • breaking

      added subschema #2: Null to the ///////// response property oneOf list for the response status

    • breaking

      added subschema #2: Null to the /////// response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 subschema #3 from the //////////////// response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 subschema #3 from the /////////////// response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 subschema #3 from the /////////////// response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 subschema #3 from the ///////////// response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 subschema #3 from the ///////////// response property oneOf list for the response status

    • info

      removed subschema #2 from the ///////// response property oneOf list for the response status

    • info

      removed subschema #2 from the /////// response property oneOf list for the response status