Save a new version (snapshot) of the flow's node tree and contact sources. Versions are immutable; activating a different version replaces the running config.
The node tree — an ordered list of steps connected by before/after edges. See the flow-node schema for the shape of each node and the payload of every node type. Every branch must terminate in an end node — a flow can have several. Branches that reconverge do so before ending; set first_common_node_id to the reconvergence node. Every node must include created_at and updated_at timestamps (unlike validate-node, which does not require them).
Who enters the flow. See the contact-source schema. Must contain at least one source — an empty array is rejected with a 422 ("The contact sources field is required.", verified on prod 2026-07-05). For a version with no audience yet, send one default source with sender_profiles: [] and after_id pointing at the tree's entry node — the same shape the backend auto-creates with a new flow shell (see KNOWN_ISSUES.md §4).
- object
- Array of any
curl -i -X POST \
'https://leadgen.grinfi.io/flows/api/flows/{flowUuid}/flow-versions' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"first_common_node_id": null,
"contact_sources": [
{
"id": 1,
"name": null,
"rotation_strategy": "fair",
"sender_profiles": [],
"after_id": 3,
"mass_actions_filter": null,
"filter_tree_format": null
}
],
"nodes": [
{
"id": 3,
"before": [],
"after": [
{
"node_id": 5,
"branch_id": 1
}
],
"type": "linkedin_send_connection_request",
"automation": "auto",
"payload": {
"template": "Hi {{first_name}}, happy to connect!",
"fallback_send": true,
"template_uuid": null
},
"delay_in_seconds": 0,
"created_at": "2026-07-05T10:00:00.000000Z",
"updated_at": "2026-07-05T10:00:00.000000Z"
},
{
"id": 5,
"before": [
{
"node_id": 3,
"branch_id": 1
}
],
"after": [
{
"node_id": 1,
"branch_id": 1
}
],
"type": "linkedin_send_message",
"automation": "auto",
"payload": {
"template": "Thanks for connecting! ...",
"attachments": [],
"template_uuid": null,
"stop_on_reply_level": "always"
},
"delay_in_seconds": 7200,
"created_at": "2026-07-05T10:00:00.000000Z",
"updated_at": "2026-07-05T10:00:00.000000Z"
},
{
"id": 1,
"before": [
{
"node_id": 5,
"branch_id": 1
}
],
"after": [],
"type": "end",
"automation": "auto",
"payload": [],
"delay_in_seconds": 0,
"created_at": "2026-07-05T10:00:00.000000Z",
"updated_at": "2026-07-05T10:00:00.000000Z"
}
]
}'