<span id="立即触发周期结构化导入"></span>

# Trigger a periodic structured import immediately

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

Submit an immediate run for an eligible periodic structured import task.

```text
POST https://api.moi.matrixorigin.cn/v5/task/run-now
```

<span id="调用前准备"></span>

## Before you call this API

Prepare a personal access token for the target workspace and the required source-read or import-run permissions. Install jq and set the example variables. See [common information](objects.md) for identity, environments, and result handoff.

<span id="请求体"></span>

## Request body

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl -X POST "https://api.moi.matrixorigin.cn/v5/task/run-now" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  --data-binary "$(jq -n --arg v0 "$TASK_ID" '{"task_id":$v0}')"
```

:::::
:::::{tab-item} Parameters

The task must be active, have created or uploading status (1 or 2), already have a Mowl workflow task, and use run_mode=periodic. Supported sources are Kafka, Doris, MySQL, and REST API. MySQL with compute configuration does not use this path. The server rechecks persisted dependencies and current permissions, then triggers the existing periodic workflow. This is not a general endpoint for resuming paused tasks or retrying arbitrary files.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `task_id` | string | Yes | Structured import task ID in the current workspace. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": null
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success; also check the HTTP and business codes. |
| `msg` | string | Response information. |
| `data` | null | The request has been accepted; no execution result is returned here. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error responses

Distinguish parameters, capabilities, authorization, and run states using [errors and environments](objects.md#errors-and-environments). HTTP 200 alone does not establish business success.
