Create agent workflow binding¶
Bind an agent task template to a workflow node. Successful creation only saves the binding and does not create plans or execution tasks.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-workflow-bindings
Before you call¶
The example below uses:
$AI_STUDIO_API_KEY: Actual personal access token.$WORKSPACE_ID: Target workspace ID.$WORKFLOW_ID: The workflow ID to be bound.$TEMPLATE_ID: Agent task template ID to use.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-workflow-bindings" -H "X-API-Key: $AI_STUDIO_API_KEY" -H "X-Workspace-ID: $WORKSPACE_ID" -H 'Content-Type: application/json' -d '{"workflow_id":"'$WORKFLOW_ID'","node_id":"summary","agent_task_template_id":"'$TEMPLATE_ID'"}'
Request body¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workflow ID. |
|
string |
Yes |
Workflow node ID. |
|
string |
Yes |
Agent task template ID. |
|
string |
No |
Workflow version ID. |
|
object |
No |
Input mapping. |
|
object |
No |
Output mapping. |
|
object |
No |
Failure handling mapping. |
|
string |
No |
Binding status. |
|
object |
No |
Tag key-value pair. |
|
object |
No |
Annotation key-value pair. |
Successful response¶
Returns 201 and a new binding on success.
{"code": 0, "data": {"id": "binding_01", "workflow_id": "wf_01", "node_id": "summary", "agent_task_template_id": "template_01"}}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
New binding ID. |
|
string |
Workflow ID. |
|
string |
Association template ID. |
Error response¶
{"code": 4, "message": "agent workflow binding already exists"}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The binding field is invalid. |
Check workflow, node and template identification. |
|
|
The same workflow node is already bound. |
Query or update existing bindings. |