Workflows

Create a workflow

Changed on

Create a draft workflow with a blank trigger and exit node. When workflowGroupId is omitted, the workflow is added to the team's Unsorted group.

post/v1/workflows

Request

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

Request body

namestring required

The name of the workflow.

descriptionstring

The description of the workflow.

mailingListIdstring nullable

The ID of a mailing list the workflow sends to. After creation, the mailing list can be changed with the /v1/workflows/{workflowId}/mailing-list endpoint.

workflowGroupIdstring

The ID of the workflow group to create this workflow in. Defaults to the team's Unsorted group when omitted.

Example request

{
  "workflowGroupId": "clg7n5p3q1r9s7t5u3v1w9y7"
}

Response

Workflow created.

idstring required

The ID of the workflow.

urlstring uri required

The URL of the workflow in the Loops app.

workflowRevisionIdstring nullable required

The current workflow revision token. Pass the latest value as expectedRevisionId on the next workflow mutation. Will be null for workflows without a revision token yet.

status'Draft' | 'Sending' | 'Paused' | 'PausedAndQueueing' required
namestring

The name of the workflow.

descriptionstring

The description of the workflow.

workflowGroupIdstring required

The ID of the workflow group this workflow belongs to.

mailingListIdstring nullable required

The ID of the mailing list the workflow sends to.

rootNodeIdstring required

The ID of the root node in the workflow graph.

nodesobject required

A map of node IDs to simplified node objects. Each node includes typeName and nextNodeIds, plus type-specific fields when present. To get the full node object, use the GET /v1/workflows/{workflowId}/nodes/{nodeId} endpoint.

Example response

{
  "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 new optional request property

    • info

      removed the non-success response with the status

    • 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 #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 #2 from the ////// response property oneOf list for the response status