Workflow nodes

Create a workflow node

Changed on

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 toNodeId, and after places it after fromNodeId when that node has exactly one outgoing connection. after is a convenience for simple linear paths, so callers do not need to fetch and pass the current child node ID. It is invalid when fromNodeId has no outgoing nodes, multiple outgoing nodes, or is an exit node. When the source has multiple outgoing nodes, use between with the exact toNodeId instead. For before, deprecated beforeNodeId requests are still accepted for compatibility, but new callers should use toNodeId.

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 400 nodes. Generated children count toward that limit, so a normal create adds 1 node, BranchNode adds 3, and ExperimentBranchNode adds 4. To add a sibling child path to a branch or experiment branch, use the POST /v1/workflows/{workflowId}/nodes/{nodeId}/add-branch endpoint. Branch paths can be edited with create-node, but a workflow cannot be started unless each direct BranchNode child is an AudienceFilter. For experiments, use create-node only to insert a missing VariantNode before non-variant content; use add-branch for another variant path.

post/v1/workflows/{workflowId}/nodes

Request

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

Request body

OR
OR

Response

Workflow node created.

Example response

{
  "node": {
    "createdChildNodes": [
      {
        "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

      removed subschema #1 subschema #2 from the /// request property oneOf list

    • 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: 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 #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

    • breaking

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

    • info

      added subschema #1: Target node subschema #2: Target node (deprecated) to the /// request property oneOf list

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

    • info

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