Skip to content

Start workflow run

POST
/v1/actions/hospitality.action.start_workflow_run/apply
curl --request POST \
--url https://api.aerandil.com/v1/actions/hospitality.action.start_workflow_run/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "expires_at": "2026-04-15T12:00:00Z", "initiating_agent_installation_id": "example", "input": "example", "run_key": "example", "target_refs": "example", "trigger_kind": "manual" }, "return_modified": false, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.workflow_definition" } }'

Start a durable execution pinned to an active definition version. Inserts a workflow_run (status pending), copies definition_hash, freezes input_snapshot and target_refs_snapshot, inserts initial workflow_step_run rows with non-root steps in planned and root steps (depends_on = []) synchronously promoted to ready before commit (AWS Step Functions StartAt precedent), creates concrete workflow_run_targets_* links per supported target type, and emits §9.1 events workflow_run.started, workflow_step.planned, workflow_step.ready. Does not start a runner — advancement requires the future executor actions.

Effects: create hospitality.workflow_run; create hospitality.workflow_step_run; link hospitality.link.workflow_run_for_definition; link hospitality.link.workflow_step_run_for_workflow_run; link hospitality.link.workflow_run_started_by_agent_installation; modify hospitality.workflow_run; link hospitality.link.workflow_run_targets_reservation; link hospitality.link.workflow_run_targets_payment; link hospitality.link.workflow_run_targets_folio; link hospitality.link.workflow_run_targets_charge; link hospitality.link.workflow_run_targets_person; link hospitality.link.workflow_run_targets_staff_member; link hospitality.link.workflow_run_targets_service_recovery_event; link hospitality.link.workflow_run_targets_fraud_risk_assessment; link hospitality.link.workflow_run_targets_message_triage; link hospitality.link.workflow_run_targets_rate_recommendation; link hospitality.link.workflow_run_targets_restriction_recommendation; link hospitality.link.workflow_run_targets_room; link hospitality.link.workflow_run_targets_membership.

Media typeapplication/json
object
branch

Apply against an open branch’s overlay view instead of the canonical (main) plane. The action’s writes land in the branch’s copy-on-first-write overlay, its events in the branch’s own stream, and the invocation is journaled for merge-by-replay. Branch writes are action-only, so this is the write-side entry point to a branch (POST /v1/branches forks one).

string format: uuid
params
required
object
expires_at
Run timeout
string format: date-time
initiating_agent_installation_id
Set when an installed agent initiated the run
string
input
required
Frozen, redacted start input
run_key
required
Host-supplied business / dedupe key
string
target_refs
Optional `[{object_type, object_id}, ...]` for graph wiring
trigger_kind
Defaults from the definition
string
Allowed values: manual event schedule webhook agent_requested api
return_modified

When true, the response carries modified_objects and modified_links projections — the engine reads the event log inside the same transaction so the projection observes the handler’s own writes.

boolean
target
required
object
id
required
string format: uuid
object_type
required
Allowed value: hospitality.workflow_definition

Action applied. modified_objects and modified_links populated when return_modified: true was supplied.

Media typeapplication/json
ApplyActionResponse

Envelope returned by the Aerandil action engine. correlation_id ties every event emitted by this invocation; modified_objects and modified_links project the events the handler emitted (per the action’s declared effects); warnings carries any non-blocking soft-validator observations.

object
correlation_id
required

Per-invocation correlation id; matches events.correlation_id for every event this action appended.

string format: uuid
modified_links
required

Links established or removed by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
from_id
required
string format: uuid
from_type
required
string
kind
required
Allowed values: linked
link_type
required
Allowed values: hospitality.link.workflow_run_for_definition hospitality.link.workflow_step_run_for_workflow_run hospitality.link.workflow_run_started_by_agent_installation hospitality.link.workflow_run_targets_reservation hospitality.link.workflow_run_targets_payment hospitality.link.workflow_run_targets_folio hospitality.link.workflow_run_targets_charge hospitality.link.workflow_run_targets_person hospitality.link.workflow_run_targets_staff_member hospitality.link.workflow_run_targets_service_recovery_event hospitality.link.workflow_run_targets_fraud_risk_assessment hospitality.link.workflow_run_targets_message_triage hospitality.link.workflow_run_targets_rate_recommendation hospitality.link.workflow_run_targets_restriction_recommendation hospitality.link.workflow_run_targets_room hospitality.link.workflow_run_targets_membership
to_id
required
string format: uuid
to_type
required
string
modified_objects
required

Objects created, modified, or soft-deleted by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
id
required
string format: uuid
kind
required
Allowed values: created modified
object_type
required
Allowed values: hospitality.workflow_run hospitality.workflow_step_run
warnings

Non-blocking soft-validator observations emitted during this invocation (e.g. comp-authority over-limit, recipe pour-cost over sell-price). Absent when no warnings were emitted.

Array<object>
object
message
required

Human-readable summary, suitable for logging or operator-UI surfacing.

string
object_type
required

Object type the warning was raised against.

string
property

Property the warning anchors to, when a single field is the locus. Absent for multi-field rules.

string
rule
required

Stable kebab-case rule identifier (e.g. comp-authority-over-limit).

string
Example
{
"modified_links": [
{
"kind": "linked",
"link_type": "hospitality.link.workflow_run_for_definition"
}
],
"modified_objects": [
{
"kind": "created",
"object_type": "hospitality.workflow_run"
}
]
}

Conflict — concurrent modification or unique constraint violation.

Validation error — parameter validation or business-rule violation.