---
title: "Create Workflow"
method: POST
path: "/v1/workflows"
tags: ["Workflow"]
---

# Create Workflow

`POST /v1/workflows`

## Request

- Base URL: `https://api.sandbox.usenash.com`
- URL: `https://api.sandbox.usenash.com/v1/workflows`
- Auth: none declared

Create a new workflow with nodes, edges, and a trigger. The workflow is created in draft status by default. Nodes define the actions and filters, edges define the execution flow between nodes, and the trigger defines when the workflow is activated. First fetch GET /workflows/schema for current action config schemas and branch rules. Bounded AI decisions use nodeType=action, nodeAction=ai_decision; a workflow may contain multiple decision nodes, each with its own config and named decision edges.

## Request body

- CreateWorkflowInputSerializer
  - `name` string, required
  - `description` string, nullable
  - `status` 'draft' | 'active' | 'inactive' | 'archived' | 'template'
  - `nodes` WorkflowNodeInputSerializer[], required
    - `nodeType` 'trigger' | 'action' | 'filter' | 'dispatch_check' | 'switch' | 'subgraph' | 'agent_invoke', required: Types of workflow nodes.
    - `nodeKey` string, required: Unique key within this workflow. Edges reference nodes by this key.
    - `nodeAction` 'dispatch_strategy' | 'optimization_strategy' | 'modify_order_price_or_tip' | 'modify_order_instructions' | 'modify_order_metadata' | 'reschedule_order' | 'add_tag' | 'flag_delivery' | 'send_email' | 'send_sms' | 'send_slack' | 'send_webhook' | 'send_to_destinations' | 'agent_call' | 'summarize' | 'extract_metadata_field' | 'add_requirements' | 'auto_reassign' | 'emit_custom_event' | 'browser_automation' | 'cancel_delivery' | 'mark_order_ready' | 'send_teams_channel_message' | 'cancel_order' | 'remove_order_from_route' | 'invoke_agent' | 'ai_decision' | 'create_route_flag' | 'update_route_flag' | 'resolve_route_flag' | 'assign_route_flags' | 'send_http_request' | 'add_validation_error' | 'generate_document': Actions that can be performed by a workflow node.
    - `nodeActionConfig` object, nullable: Config for the action. Shape depends on node_action. See GET /workflows/schema.
    - `nodeFilterConfig` object[], nullable: Filter conditions. Each dict has field, operator, and value. See GET /workflows/schema for available fields and operators.
    - `nodeLabel` string, required: Human-readable label for this node.
    - `isEnabled` boolean, nullable
    - `isTrigger` boolean, nullable
  - `edges` WorkflowEdgeInputSerializer[], required
    - `edgeKey` string, required: Unique key within this workflow.
    - `sourceNodeKey` string, required: node_key of the source node.
    - `targetNodeKey` string, required: node_key of the target node.
    - `executionOrder` integer, required: Execution order when a node has multiple outgoing edges.
    - `edgeType` 'default' | 'success' | 'negative' | 'decision'
    - `branchKey` string, nullable: Required only for decision edges from ai_decision: yes/no for yes_no, a configured choices[].key for choice, above/below for score, or uncertain/error for any mode. At most one edge per outcome per node.
  - `trigger` WorkflowTriggerInputSerializer, required
    - `triggerType` 'manual' | 'webhook' | 'cron' | 'event' | 'subgraph', required: Types of workflow triggers.
    - `eventTriggerType` string, nullable: For notification-based triggers only. Pass the entry's 'value' from the GET /workflows/schema triggers list, not the trigger key. Leave null for event triggers like order.created.
    - `eventName` string, nullable: The event to listen for. For schema entries whose input_field is 'eventName', pass the entry's value here (e.g. 'order.created'). For notification triggers, omit this. Defaults to 'notification_trigger.tripped'.
    - `customEventDefinitionId` string, nullable: Reference to a pre-defined custom event from the organization's catalog. Mutually exclusive with eventName: the definition's key becomes the trigger's event name. Not valid for cron triggers.
    - `courierFormDefinitionId` string, nullable: Reference to a CourierFormDefinition. Required when eventName is 'courier_form.submitted'; not valid for any other trigger type.
    - `notificationTriggerParameters` object, nullable: Extra config for notification triggers. Not used for event triggers.
    - `isEnabled` boolean, nullable

## Other responses

- `422`: Unprocessable Content

---

[API](https://skmtc.dev/nash/apis/nash-api.md) - [All operations](https://skmtc.dev/nash/apis/nash-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nash/apis/nash-api/revisions/e3713837c5c9?raw)
