---
orphan: true
---

# Update agent workflow binding

Update a bound workflow, node, template, or input-output mapping.

```text
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-workflow-bindings/{binding_id}
```

## Before you call

The example below uses:

- `$AI_STUDIO_API_KEY`: Actual personal access token.
- `$WORKSPACE_ID`: Target workspace ID.
- `$BINDING_ID`: Binding ID to update.

## Request example

```bash
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-workflow-bindings/$BINDING_ID" -H "X-API-Key: $AI_STUDIO_API_KEY" -H "X-Workspace-ID: $WORKSPACE_ID" -H 'Content-Type: application/json' -d '{"input_mapping":{"document":"$.content"}}'
```

## Request body

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | No | Workflow ID. |
| `workflow_version_id` | string | No | Workflow version ID. |
| `node_id` | string | No | Workflow node ID. |
| `agent_task_template_id` | string | No | Agent task template ID. |
| `input_mapping` | object | No | Input mapping. |
| `output_mapping` | object | No | Output mapping. |
| `failure_mapping` | object | No | Failure handling mapping. |
| `status` | string | No | Binding status. |
| `labels` | object | No | Tag key-value pair. |
| `annotations` | object | No | Annotation key-value pair. |

## Successful response

Returns `200` and the updated binding on success.

```json
{"code": 0, "data": {"id": "binding_01", "input_mapping": {"document": "$.content"}}}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | `0` on success. |
| `data.id` | string | Binding ID. |
| `data.input_mapping` | object | The updated input map. |

## Error response

```json
{"code": 5, "message": "agent workflow binding not found"}
```

### Common HTTP errors

```{list-table}
:header-rows: 1

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `2`
  - The request body is invalid.
  - Check the fields to be updated.
* - `404`
  - `5`
  - The binding does not exist.
  - Check the binding ID.
```
