工作流
工作流是产品替你运行的自动化:一个触发器、一张步骤图,以及随事件到来推进的运行。草稿与发布分离,所以流量执行的永远是有人刻意发布的版本。
At a glance
- Shape
- A trigger, a graph of steps, published versions
- Triggers
- Manual fire, or a cohort signal
- Operate
fireWorkflow,signalWorkflow,cancelWorkflow- Live updates
workflow.runon the project room- Auth
- Access token; runs execute server-side
- 触发器是手动触发或群组信号,所以"谁"是一个群组,而不是手写的条件。
- 步骤涵盖动作、延迟、分支和有护栏的跳转;引擎会拒绝的图在发布前就被指出。
- 每次运行都保留它的原因:等待说出它等的信号,失败带着它的错误。
工作原理
A definition holds a draft graph and its published versions. The draft is edited freely and saved as it changes; publishing validates the graph and makes that version the one runs execute, so an edit in progress can never leak into traffic. A run advances node by node: actions do work, delays hold, branches choose a case or the otherwise, and a waiting node parks the run until its named signal arrives, from the product or by hand. Runs, their steps and their errors are all kept, which is what the console's runs tab and the Home screen's Needs you list read.
如何访问
| Surface | Operation |
|---|---|
| REST | None: workflows are authored and operated, not ingested |
| GraphQL | workflowDefinitions, workflowRuns queries · publishWorkflowVersion, fireWorkflow, signalWorkflow, cancelWorkflow mutations |
| Realtime | workflow.run on the project room, as a run advances |
| MCP | prodantix.workflows.list |
示例
Bash
curl "https://api.prodantix.com/graphql" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation ($p: String!, $d: String!) { fireWorkflow(projectId: $p, definitionId: $d) { runId } }",
"variables": { "p": "'$PROJECT_ID'", "d": "'$DEFINITION_ID'" }
}'