# Rerun processing node with specified output version

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Rerun the node using the specified output revision.

```text
POST https://moi.matrixorigin.cn/newmoi/lineage/artifacts/{artifact_id}/nodes/{node_id}/output-emissions/{target_output_emission_id}/rerun-with-revisions
```

## Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace.


## Request body

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>mode</code><span class="mo-api-field__type">string</span></dt><dd>Rerun mode; when provided, it must be rerun_downstream_with_revisions.</dd></div>
  <div class="mo-api-field"><dt><code>source_effective_set_version</code><span class="mo-api-field__type">integer</span></dt><dd>Source effective revision set version.</dd></div>
  <div class="mo-api-field"><dt><code>selected_revisions_json</code><span class="mo-api-field__type">object</span></dt><dd>The selected revision collection.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Request example</p>
```

```bash
curl -X POST "https://moi.matrixorigin.cn/newmoi/lineage/artifacts/$ARTIFACT_ID/nodes/$NODE_ID/output-emissions/$TARGET_OUTPUT_EMISSION_ID/rerun-with-revisions" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "rerun_downstream_with_revisions",
    "source_effective_set_version": 4,
    "selected_revisions_json": {"block-001": {"revision_id": "rev-002"}}
  }'
```

:::
::::

## Successful response

When the request is successful, the data of this operation is returned. Just because the write or run request has been accepted does not mean that the subsequent processing has been completed; please confirm the result based on the return status or subsequent query.


The response fields are as follows.

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>data.artifact_id</code><span class="mo-api-field__type">string</span></dt><dd>Product ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.node_id</code><span class="mo-api-field__type">string</span></dt><dd>Node ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.rerun_id</code><span class="mo-api-field__type">string</span></dt><dd>Rerun ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.branch_id</code><span class="mo-api-field__type">string</span></dt><dd>New branch ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.case_id</code><span class="mo-api-field__type">string</span></dt><dd>Processing case ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.status</code><span class="mo-api-field__type">string</span></dt><dd>Rerun status.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Successful response example</p>
```

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {"artifact_id": "art-001", "node_id": "node-001", "rerun_id": "rerun-001", "status": "submitted"}
}
```

:::
::::

## Error response

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>Error code.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>Readable error message.</dd></div>
  <div class="mo-api-field"><dt><code>data</code><span class="mo-api-field__type">null</span></dt><dd>`null` in an error response.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Error response example</p>
```

```json
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
```

:::
::::
