Topolo Docs Topolo Platform
Open workspace

Create journey draft

Create a journey as an unpublished draft. definition = { trigger { eventTypes[], segmentIds[] }, entryNodeId, nodes[], allowReentry? }. Nodes: delay { delay { mode duration, minutes } | { mode time_of_day, time HH:MM, fallbackTimezone }, next }, branch { condition contact_field | event (withinDays) | segment (member/not_member), yes, no }, send { templateRef, purpose, topicKey (required unless transactional), messageCategory (transactional), next }, split { arms [{ key, weight 0-100, next }] (2-5), holdoutPercent 0-50 } (A/B test: hash of experiment and contact picks the arm; holdout exits), goal { eventType } (journey-wide: a goal event exits the contact as converted), exit. The draft is saved even when the graph is incomplete; problems[] lists what publish would reject. Nothing is enrolled or sent.

Outcome

Create a journey as an unpublished draft. definition = { trigger { eventTypes[], segmentIds[] }, entryNodeId, nodes[], allowReentry? }. Nodes: delay { delay { mode duration, minutes } | { mode time_of_day, time HH:MM, fallbackTimezone }, next }, branch { condition contact_field | event (withinDays) | segment (member/not_member), yes, no }, send { templateRef, purpose, topicKey (required unless transactional), messageCategory (transactional), next }, split { arms [{ key, weight 0-100, next }] (2-5), holdoutPercent 0-50 } (A/B test: hash of experiment and contact picks the arm; holdout exits), goal { eventType } (journey-wide: a goal event exits the contact as converted), exit. The draft is saved even when the graph is incomplete; problems[] lists what publish would reject. Nothing is enrolled or sent.

Before you start

  • Verify identity and pin the intended organization and environment before discovering the action.
  • Discover a granted Nurture workspace. The application permission is workspace:write; required workspace access is read_write. A permission alone does not supply a workspace grant.
  • Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.
  • Obtain authorization for the documented effect or personal-data export before supplying CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.journeys.create --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json

Request

POST /api/journeys

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
nameRequiredstring{"minLength":1,"maxLength":120}
descriptionOptionalSee schema{}
definitionRequiredobject{}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ]
    },
    "definition": {
      "type": "object",
      "properties": {
        "trigger": {
          "type": "object",
          "properties": {
            "eventTypes": {
              "maxItems": 10,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "signup",
                  "trial_started",
                  "trial_ending",
                  "form_submitted",
                  "purchase",
                  "subscription_changed",
                  "feature_used",
                  "inactive",
                  "mql",
                  "engage_not_now"
                ]
              }
            },
            "segmentIds": {
              "maxItems": 10,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            }
          },
          "required": [
            "eventTypes",
            "segmentIds"
          ],
          "additionalProperties": false
        },
        "entryNodeId": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
        },
        "nodes": {
          "minItems": 1,
          "maxItems": 100,
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "delay"
                  },
                  "delay": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "duration"
                          },
                          "minutes": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 129600
                          }
                        },
                        "required": [
                          "mode",
                          "minutes"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "time_of_day"
                          },
                          "time": {
                            "type": "string",
                            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                          },
                          "fallbackTimezone": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          }
                        },
                        "required": [
                          "mode",
                          "time",
                          "fallbackTimezone"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "next": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "delay",
                  "next"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "branch"
                  },
                  "yes": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "no": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "condition": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "contact_field"
                          },
                          "field": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,62}$"
                          },
                          "operator": {
                            "type": "string",
                            "enum": [
                              "equals",
                              "not_equals",
                              "contains",
                              "exists",
                              "not_exists"
                            ]
                          },
                          "value": {
                            "type": "string",
                            "maxLength": 500
                          }
                        },
                        "required": [
                          "kind",
                          "field",
                          "operator"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "event"
                          },
                          "eventType": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.]{0,62}$"
                          },
                          "operator": {
                            "type": "string",
                            "enum": [
                              "performed",
                              "not_performed"
                            ]
                          },
                          "withinDays": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 365
                          }
                        },
                        "required": [
                          "kind",
                          "eventType",
                          "operator",
                          "withinDays"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "segment"
                          },
                          "segmentId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "operator": {
                            "type": "string",
                            "enum": [
                              "member",
                              "not_member"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "segmentId",
                          "operator"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "yes",
                  "no",
                  "condition"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "send"
                  },
                  "next": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "templateRef": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "marketing",
                      "outreach",
                      "transactional"
                    ]
                  },
                  "topicKey": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "messageCategory": {
                    "type": "string",
                    "enum": [
                      "receipt",
                      "password_reset",
                      "account_security",
                      "billing",
                      "order_update",
                      "service_notice"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "next",
                  "templateRef",
                  "purpose"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "split"
                  },
                  "arms": {
                    "minItems": 2,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                        },
                        "weight": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "next": {
                          "type": "string",
                          "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                        }
                      },
                      "required": [
                        "key",
                        "weight",
                        "next"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "holdoutPercent": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "arms"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "goal"
                  },
                  "eventType": {
                    "type": "string",
                    "enum": [
                      "signup",
                      "trial_started",
                      "trial_ending",
                      "form_submitted",
                      "purchase",
                      "subscription_changed",
                      "feature_used",
                      "inactive",
                      "mql",
                      "engage_not_now"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "eventType"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "exit"
                  }
                },
                "required": [
                  "id",
                  "kind"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "allowReentry": {
          "type": "boolean"
        }
      },
      "required": [
        "trigger",
        "entryNodeId",
        "nodes"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "name",
    "definition"
  ],
  "additionalProperties": false
}

Effects

  • Creates one draft journey; no contact is enrolled and nothing is sent.

Interpret the response

The returned identifier path is $.journey.id for journey. Empty lists do not discover a target.

Call app_topolo_nurture.journeys.get and confirm the stored definition; resolve problems[] before app_topolo_nurture.journeys.publish.

Exact success schema:

{
  "type": "object",
  "required": [
    "journey",
    "problems"
  ],
  "properties": {
    "journey": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "definition": {
          "type": "object"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "archived"
          ]
        },
        "currentVersion": {
          "type": [
            "integer",
            "null"
          ]
        },
        "hasUnpublishedChanges": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      }
    },
    "problems": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}

Worked examples

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.

Successful request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "name": "Welcome",
  "definition": {
    "trigger": {
      "eventTypes": [
        "inactive"
      ],
      "segmentIds": []
    },
    "entryNodeId": "hello",
    "nodes": [
      {
        "id": "hello",
        "kind": "send",
        "next": "wait",
        "templateRef": "welcome-1",
        "purpose": "marketing",
        "topicKey": "news"
      },
      {
        "id": "wait",
        "kind": "delay",
        "delay": {
          "mode": "duration",
          "minutes": 60
        },
        "next": "check"
      },
      {
        "id": "check",
        "kind": "branch",
        "yes": "done",
        "no": "nudge",
        "condition": {
          "kind": "contact_field",
          "field": "plan",
          "operator": "equals",
          "value": "pro"
        }
      },
      {
        "id": "nudge",
        "kind": "send",
        "next": "done",
        "templateRef": "nudge-1",
        "purpose": "marketing",
        "topicKey": "news"
      },
      {
        "id": "bought",
        "kind": "goal",
        "eventType": "purchase"
      },
      {
        "id": "done",
        "kind": "exit"
      }
    ]
  }
}

CLI:

topolo actions validate app_topolo_nurture.journeys.create --data @payload.json --json
topolo actions plan app_topolo_nurture.journeys.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.journeys.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.journeys.create",
    "input": {
      "name": "Welcome",
      "definition": {
        "trigger": {
          "eventTypes": [
            "inactive"
          ],
          "segmentIds": []
        },
        "entryNodeId": "hello",
        "nodes": [
          {
            "id": "hello",
            "kind": "send",
            "next": "wait",
            "templateRef": "welcome-1",
            "purpose": "marketing",
            "topicKey": "news"
          },
          {
            "id": "wait",
            "kind": "delay",
            "delay": {
              "mode": "duration",
              "minutes": 60
            },
            "next": "check"
          },
          {
            "id": "check",
            "kind": "branch",
            "yes": "done",
            "no": "nudge",
            "condition": {
              "kind": "contact_field",
              "field": "plan",
              "operator": "equals",
              "value": "pro"
            }
          },
          {
            "id": "nudge",
            "kind": "send",
            "next": "done",
            "templateRef": "nudge-1",
            "purpose": "marketing",
            "topicKey": "news"
          },
          {
            "id": "bought",
            "kind": "goal",
            "eventType": "purchase"
          },
          {
            "id": "done",
            "kind": "exit"
          }
        ]
      }
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "journey": {
    "id": "jny_a4e00379d5a046c4ac93d74dcb7a0464",
    "name": "Welcome",
    "description": null,
    "definition": {
      "trigger": {
        "eventTypes": [
          "inactive"
        ],
        "segmentIds": []
      },
      "entryNodeId": "hello",
      "nodes": [
        {
          "id": "hello",
          "kind": "send",
          "next": "wait",
          "templateRef": "welcome-1",
          "purpose": "marketing",
          "topicKey": "news"
        },
        {
          "id": "wait",
          "kind": "delay",
          "delay": {
            "mode": "duration",
            "minutes": 60
          },
          "next": "check"
        },
        {
          "id": "check",
          "kind": "branch",
          "yes": "done",
          "no": "nudge",
          "condition": {
            "kind": "contact_field",
            "field": "plan",
            "operator": "equals",
            "value": "pro"
          }
        },
        {
          "id": "nudge",
          "kind": "send",
          "next": "done",
          "templateRef": "nudge-1",
          "purpose": "marketing",
          "topicKey": "news"
        },
        {
          "id": "bought",
          "kind": "goal",
          "eventType": "purchase"
        },
        {
          "id": "done",
          "kind": "exit"
        }
      ]
    },
    "status": "draft",
    "currentVersion": null,
    "hasUnpublishedChanges": true,
    "createdAt": "2026-10-04T00:32:37.632Z",
    "updatedAt": "2026-10-04T00:32:37.632Z"
  },
  "problems": []
}

HTTP 201. Call app_topolo_nurture.journeys.get and confirm the stored definition; resolve problems[] before app_topolo_nurture.journeys.publish.

Another supported request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "name": "Welcome",
  "definition": {
    "trigger": {
      "eventTypes": [
        "subscription_changed"
      ],
      "segmentIds": []
    },
    "entryNodeId": "hello",
    "nodes": [
      {
        "id": "hello",
        "kind": "send",
        "next": "wait",
        "templateRef": "welcome-1",
        "purpose": "marketing",
        "topicKey": "news"
      },
      {
        "id": "wait",
        "kind": "delay",
        "delay": {
          "mode": "duration",
          "minutes": 60
        },
        "next": "check"
      },
      {
        "id": "check",
        "kind": "branch",
        "yes": "done",
        "no": "nudge",
        "condition": {
          "kind": "contact_field",
          "field": "plan",
          "operator": "equals",
          "value": "pro"
        }
      },
      {
        "id": "nudge",
        "kind": "send",
        "next": "done",
        "templateRef": "nudge-1",
        "purpose": "marketing",
        "topicKey": "news"
      },
      {
        "id": "done",
        "kind": "exit"
      },
      {
        "id": "won",
        "kind": "goal",
        "eventType": "feature_used"
      }
    ]
  }
}

CLI:

topolo actions validate app_topolo_nurture.journeys.create --data @payload.json --json
topolo actions plan app_topolo_nurture.journeys.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.journeys.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.journeys.create",
    "input": {
      "name": "Welcome",
      "definition": {
        "trigger": {
          "eventTypes": [
            "subscription_changed"
          ],
          "segmentIds": []
        },
        "entryNodeId": "hello",
        "nodes": [
          {
            "id": "hello",
            "kind": "send",
            "next": "wait",
            "templateRef": "welcome-1",
            "purpose": "marketing",
            "topicKey": "news"
          },
          {
            "id": "wait",
            "kind": "delay",
            "delay": {
              "mode": "duration",
              "minutes": 60
            },
            "next": "check"
          },
          {
            "id": "check",
            "kind": "branch",
            "yes": "done",
            "no": "nudge",
            "condition": {
              "kind": "contact_field",
              "field": "plan",
              "operator": "equals",
              "value": "pro"
            }
          },
          {
            "id": "nudge",
            "kind": "send",
            "next": "done",
            "templateRef": "nudge-1",
            "purpose": "marketing",
            "topicKey": "news"
          },
          {
            "id": "done",
            "kind": "exit"
          },
          {
            "id": "won",
            "kind": "goal",
            "eventType": "feature_used"
          }
        ]
      }
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "journey": {
    "id": "jny_9ba96e2c4dc24cc0b39eba6529d5456d",
    "name": "Welcome",
    "description": null,
    "definition": {
      "trigger": {
        "eventTypes": [
          "subscription_changed"
        ],
        "segmentIds": []
      },
      "entryNodeId": "hello",
      "nodes": [
        {
          "id": "hello",
          "kind": "send",
          "next": "wait",
          "templateRef": "welcome-1",
          "purpose": "marketing",
          "topicKey": "news"
        },
        {
          "id": "wait",
          "kind": "delay",
          "delay": {
            "mode": "duration",
            "minutes": 60
          },
          "next": "check"
        },
        {
          "id": "check",
          "kind": "branch",
          "yes": "done",
          "no": "nudge",
          "condition": {
            "kind": "contact_field",
            "field": "plan",
            "operator": "equals",
            "value": "pro"
          }
        },
        {
          "id": "nudge",
          "kind": "send",
          "next": "done",
          "templateRef": "nudge-1",
          "purpose": "marketing",
          "topicKey": "news"
        },
        {
          "id": "done",
          "kind": "exit"
        },
        {
          "id": "won",
          "kind": "goal",
          "eventType": "feature_used"
        }
      ]
    },
    "status": "draft",
    "currentVersion": null,
    "hasUnpublishedChanges": true,
    "createdAt": "2026-10-04T00:32:37.381Z",
    "updatedAt": "2026-10-04T00:32:37.381Z"
  },
  "problems": []
}

HTTP 201. Call app_topolo_nurture.journeys.get and confirm the stored definition; resolve problems[] before app_topolo_nurture.journeys.publish.

Refused request · invalid_input

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "name": "Bad",
  "definition": {
    "trigger": {
      "eventTypes": [
        "signup"
      ],
      "segmentIds": []
    },
    "entryNodeId": "hello",
    "nodes": [
      {
        "id": "x",
        "kind": "email"
      }
    ]
  }
}

CLI:

topolo actions validate app_topolo_nurture.journeys.create --data @payload.json --json
topolo actions plan app_topolo_nurture.journeys.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 422:

{
  "error": {
    "code": "invalid_input",
    "message": "The input does not match the action schema.",
    "details": [
      {
        "code": "invalid_union",
        "errors": [],
        "note": "No matching discriminator",
        "discriminator": "kind",
        "options": [
          "delay",
          "branch",
          "send",
          "split",
          "goal",
          "exit"
        ],
        "path": [
          "definition",
          "nodes",
          0,
          "kind"
        ],
        "message": "Invalid discriminator value. Expected 'delay' | 'branch' | 'send' | 'split' | 'goal' | 'exit'"
      }
    ]
  }
}

HTTP 422. Preserve the refusal details and do not claim success.

Refused request · permission_denied

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "name": "x",
  "definition": {
    "trigger": {
      "eventTypes": [
        "signup"
      ],
      "segmentIds": []
    },
    "entryNodeId": "hello",
    "nodes": [
      {
        "id": "hello",
        "kind": "send",
        "next": "wait",
        "templateRef": "welcome-1",
        "purpose": "marketing",
        "topicKey": "news"
      },
      {
        "id": "wait",
        "kind": "delay",
        "delay": {
          "mode": "duration",
          "minutes": 60
        },
        "next": "check"
      },
      {
        "id": "check",
        "kind": "branch",
        "yes": "done",
        "no": "nudge",
        "condition": {
          "kind": "contact_field",
          "field": "plan",
          "operator": "equals",
          "value": "pro"
        }
      },
      {
        "id": "nudge",
        "kind": "send",
        "next": "done",
        "templateRef": "nudge-1",
        "purpose": "marketing",
        "topicKey": "news"
      },
      {
        "id": "bought",
        "kind": "goal",
        "eventType": "purchase"
      },
      {
        "id": "done",
        "kind": "exit"
      }
    ]
  }
}

CLI:

topolo actions validate app_topolo_nurture.journeys.create --data @payload.json --json
topolo actions plan app_topolo_nurture.journeys.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 403:

{
  "error": {
    "code": "permission_denied",
    "message": "The credential lacks workspace:write.",
    "details": {
      "requiredPermission": "workspace:write"
    }
  }
}

HTTP 403. Preserve the refusal details and do not claim success.

Verify the result

  • Call app_topolo_nurture.journeys.get and confirm the stored definition; resolve problems[] before app_topolo_nurture.journeys.publish.

Errors and recovery

  • organization_required (HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.
  • permission_denied (HTTP 403): Grant the credential the required Nurture workspace permission.
  • workspace_required (HTTP 409): Create a Nurture workspace, or pass the workspace resource context.
  • invalid_input (HTTP 422): Correct the fields named in error.details using inputSchema, then retry.

Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.

Recovery boundary

Archive a journey created in error.

  • Validate journey draft: Check the draft exactly as publish would: one entry node, every edge pointing at an existing non-goal node, every node reachable, no loop without a delay, at least one exit, send nodes with a topicKey (or messageCategory when transactional), known fallback time zones, and active referenced segments and topics.
  • Simulate journey: Walk the draft (or a published version) for one real contact (contactId) or an inline sample { fields, timezone, events[], segmentIds[] } on a simulated clock from startAt (default now), jumping over delays, and return the path with timings. Side-effect free: nothing is enrolled, reserved or recorded; for a real contact each send asks eligibility.check what would happen at that simulated time (intended, deferred, blocked). Stops at exit, goal conversion or maxSteps (truncated true).
  • Publish journey version: Freeze the current draft as the next immutable version and make it live: new trigger matches and manual enrollments use it from now on. Existing enrollments stay pinned to the version they entered on. Refused when the draft is invalid or unchanged since the last publish.
  • Archive journey: Archive a journey: it stops enrolling contacts, every active enrollment exits with reason journey_archived, and the draft can no longer change. Versions, enrollment history and intended sends are kept.

Evidence

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.