GET
/
v2
/
workflows
/
messageLogs
curl https://qstash.upstash.io/v2/workflows/messageLogs \
  -H "Authorization: Bearer <token>"
{
  "cursor": "",
  "events": [
    {
      "time": 1738788333107,
      "state": "CREATED",
      "workflowRunId": "wfr_6MXE3GfddpBMWJM7s5WSRPqwcFm8",
      "workflowUrl": "http://my-workflow-server.com/workflowEndpoint",
      "workflowCreatedAt": 1738788333105,
      "stepInfo": {
        "stepName": "init",
        "stepType": "Initial",
        "callType": "step",
        "messageId": "msg_2KxeAKGVEjwDjNK1TVPormoRf7shRyNBpPThVbpvkuZNqri4cXp5nwSajNzAs6UWakvbco3qEPvtjQU3qxqjWarm2kisK",
        "concurrent": 1,
        "createdAt": 1738788333106
      },
      "nextDeliveryTime": 1738788333106
    },
    {
      "time": 1738788333107,
      "state": "RUN_STARTED",
      "workflowRunId": "wfr_6MXE3GfddpBMWJM7s5WSRPqwcFm8",
      "workflowUrl": "http://my-workflow-server.com/workflowEndpoint",
      "workflowCreatedAt": 1738788333105
    }
  ]
}

The message logs provide a more detailed version of the List Workflow Runs API. If you need an overview of a workflow run, that API is more useful, as it returns grouped and processed data.

Each step in a workflow is associated with a message. During its lifecycle, a message generates multiple logs.

For example, when you trigger a workflow, a message is created to execute the first step of the workflow. This message logs a CREATED state and then waits to be processed by the server. Once successfully processed, it logs a DELIVERED state. Some data may be duplicated across these events.

In addition to logs generated by messages, we also generate some logs at the workflow run level. For instance, when a workflow is triggered, we log a RUN_STATED state. Similarly, we log RUN_FAILED, RUN_SUCCESS, and other states to track execution status.

The flat view returns all logs generated by a workflow run in their raw format. By checking the flat view, you can see all the lifecycle of workflow run.

Request

cursor
string

By providing a cursor you can paginate through all of the workflow runs.

workflowRunId
string

Filters logs by workflow run ID.

workflowUrl
string

Filters logs by the workflow server URL.

workflowCreatedAt
number

Filters logs by creation date of workflow run (Unix timestamp in milliseconds).

state
string

Filter logs by state, either the state of an individual message or by a state that is generated at the workflow level.

Refer to Debug Logs page for the list of states of an individual message.

The list of states at the workflow level:

ValueDescription
RUN_STARTEDThe workflow has started to run and currently in progress.
RUN_SUCCESSThe workflow run has completed succesfully.
RUN_FAILEDSome errors has occured and workflow failed after all retries.
RUN_CANCELEDThe workflow run has canceled upon user request.
WAITER_ADDEDA new waiter is registered for this workflow run.
INVOKEDA new workflow run started by this workflow.
messageId
string

Filter logs by message ID of a particular step

workflowCreatedAt
number

Filters logs by creation date of workflow run (Unix timestamp in milliseconds).

fromDate
number

Filters logs starting from this date (Unix timestamp in milliseconds, inclusive).

toDate
number

Filters logs ending at this date (Unix timestamp in milliseconds, inclusive).

count
number

Specifies the number of logs to return (default and max: 1000).

Response

Each field in the logs is associated with the workflow run and the steps that flushed it.

cursor
string

A cursor which you can use in subsequent requests to paginate through all logs. If no cursor is returned, you have reached the end of the logs.

events
Array
curl https://qstash.upstash.io/v2/workflows/messageLogs \
  -H "Authorization: Bearer <token>"
{
  "cursor": "",
  "events": [
    {
      "time": 1738788333107,
      "state": "CREATED",
      "workflowRunId": "wfr_6MXE3GfddpBMWJM7s5WSRPqwcFm8",
      "workflowUrl": "http://my-workflow-server.com/workflowEndpoint",
      "workflowCreatedAt": 1738788333105,
      "stepInfo": {
        "stepName": "init",
        "stepType": "Initial",
        "callType": "step",
        "messageId": "msg_2KxeAKGVEjwDjNK1TVPormoRf7shRyNBpPThVbpvkuZNqri4cXp5nwSajNzAs6UWakvbco3qEPvtjQU3qxqjWarm2kisK",
        "concurrent": 1,
        "createdAt": 1738788333106
      },
      "nextDeliveryTime": 1738788333106
    },
    {
      "time": 1738788333107,
      "state": "RUN_STARTED",
      "workflowRunId": "wfr_6MXE3GfddpBMWJM7s5WSRPqwcFm8",
      "workflowUrl": "http://my-workflow-server.com/workflowEndpoint",
      "workflowCreatedAt": 1738788333105
    }
  ]
}