logs
method retrieves workflow run logs using the List Workflow Runs API.
Arguments
Filter by a specific workflow run ID.
Maximum number of runs to return. Defaults to a system-defined value if not specified.
Filter workflow runs by execution state.
State | Description |
---|---|
RUN_STARTED | The workflow run is in progress. |
RUN_SUCCESS | The workflow run completed successfully. |
RUN_FAILED | The run failed after all retries. |
RUN_CANCELED | The run was manually canceled. |
Filter by the exact workflow URL.
Filter by the workflow creation time (Unix timestamp).
A pagination cursor from a previous request.
Use this to fetch the next set of results.
Response
A cursor to use for pagination.
If no cursor is returned, there are no more workflow runs.
Show child attributes
Show child attributes
The ID of the workflow run.
The URL address of the workflow endpoint.
The current state of the workflow run at this point in time
Value | Description |
---|---|
RUN_STARTED | The workflow has started to run and currently in progress. |
RUN_SUCCESS | The workflow run has completed succesfully. |
RUN_FAILED | Some errors has occured and workflow failed after all retries. |
RUN_CANCELED | The workflow run has canceled upon user request. |
The Unix timestamp (in milliseconds) when the workflow run started.
The Unix timestamp (in milliseconds) when the workflow run was completed, if applicable.
The label of the run assigned by the user on trigger.
The details of the failure callback message, if a failure function was defined for the workflow.
Show child attributes
Show child attributes
The ID of the failure callback message
The URL address of the failure function
The state of the failure callback
Value |
---|
CALLBACK_INPROGRESS |
CALLBACK_SUCCESS |
CALLBACK_FAIL |
The HTTP headers of the message that triggered the failure function.
The HTTP response status of the message that triggered the failure function.
The response body of the message that triggered the failure function.
The DLQ ID of the workflow run.
Response body of the failure function/url.
When failure function is used, this contains
the returned message from the failure function.
Reponse headers of the failure function/url. This is valuable when the call to run the failure function/url is rejected
because of a platform limit.
Reponse status of the failure function/url. This is valuable when the call to run the failure function/url is rejected
because of a platform limit.
A call to failure url/function can be retried as
maxRetries
time. This array contains errors of all retry
attempts.Show child attributes
Show child attributes
Response status of the endpoint that caused the error
Response Headers of the endpoint that caused the error
Response Body of the endpoint that caused the error if available
An error message that happened before/after calling the user's endpoint.
The time of the error happened in Unix time milliseconds
Max number of retries configured when seeing an error.
Hide child attributes
Hide child attributes
The type of grouped steps
Value | Description |
---|---|
sequential | Indicates only one step is excuted sequentially |
parallel | Indicates multiple steps being executed in parallel. |
next | Indicates there is information about currently executing step(s) |
Show child attributes
Show child attributes
The ID of the step which increases monotonically.
The name of the step. It is specified in workflow by user.
Execution type of the step which indicates type of the context function.
Value | Function |
---|---|
Initial | The default step which created automatically |
Run | context.run() |
Call | context.call() |
SleepFor | context.sleepFor() |
SleepUntil | context.sleepUntil() |
Wait | context.waitForEvent() |
Notify | context.notify() |
Invoke | context.invoke() |
The ID of the message associated with this step.
The output returned by the step
The total number of concurrent steps that is running alongside this step
The state of this step at this point in time
Value |
---|
STEP_SUCCESS |
STEP_RETRY |
STEP_FAILED |
STEP_CANCELED |
The unix timestamp in milliseconds when the message associated with this step has created.
The unix timestamp in milliseconds when this step will be retried.
This is set only when the step state is
STEP_RETRY
The duration in milliseconds which step will sleep. Only set if stepType is
SleepFor
.The unix timestamp (in milliseconds) which step will sleep until. Only set if stepType is
SleepUntil
.The event id of the wait step. Only set if stepType is
Wait
.The unix timestamp (in milliseconds) when the wait will time out.
The duration of timeout in human readable format (e.g. 120s, 1m, 1h).
Set to true if this step is cause of a wait timeout rather than notifying the waiter.
The URL of the external address. Available only if stepType is
Call
.The HTTP method of the request sent to the external address. Available only if stepType is
Call
.The HTTP headers of the request sent to the external address. Available only if stepType is
Call
.The body of the request sent to the external address. Available only if stepType is
Call
.The HTTP status returned by the external call. Available only if stepType is
Call
.The body returned by the external call. Available only if stepType is
Call
.The HTTP headers returned by the external call. Available only if stepType is
Call
.The ID of the invoked workflow run if this step is an invoke step.
The URL address of the workflow server of invoked workflow run if this step is an invoke step.
The Unix timestamp (in milliseconds) when the invoked workflow was started if this step is an invoke step.
The body passed to the invoked workflow if this step is an invoke step.
The HTTP headers passed to invoked workflow if this step is an invoke step.
Usage
Copy
Ask AI
import { Client } from "@upstash/workflow";
const client = new Client({ token: "<QSTASH_TOKEN>" })
const { runs, cursor } = await client.logs({})