Skip to main content
All MuleRouter asynchronous tasks follow the same usage pattern: Create a task via a POST request, then use GET requests to retrieve its latest status and result.

Task response structure

All asynchronous task responses follow the structure below:

Task Information Object

task_info
object
required
Task Information object

Task Result

The corresponding JSON structure is as follows:
When querying, use the task ID to fetch the execution status and result.

Create a task

MuleRouter integrates multiple model vendors. Some requests are synchronous or streaming, while others involve longer inference cycles. To improve the developer experience, we expose these as asynchronous tasks. Create an asynchronous task via POST /vendors/dummy/v1/videos/generation. You will receive a response similar to the following:

Retrieve task status and result

In the above example, the task ID is 123e4567-e89b-12d3-a456-426614174000. To retrieve the latest status and result for the task ID. Use GET /vendors/dummy/v1/videos/generation/123e4567-e89b-12d3-a456-426614174000. For example, when the task status is succeeded, you may receive a response like the following:
The exact result payload varies by endpoint, refer to the model documentation. The task info response envelope remains consistent.

Failed tasks

If a task finishes with status: "failed", the response includes an error object describing what went wrong. The HTTP status of the GET itself is still 200 — the lookup succeeded, the task it describes did not.
The error_code is the authoritative signal for what went wrong. The most common codes for failed async tasks are:
  • 30013005: the upstream model provider could not complete the task.
  • 4002, 4008: a MuleRouter-side error occurred while running the task.
See Error Codes for the full list and the meaning of each code.

Task lifecycle

A task only ever leaves queued / running once — once it is succeeded or failed, it stays in that state.

Common errors