lt.exports
lt.exports reads workflow jobs out of Postgres: job listings, stored state, full execution trees and status. See Data model.
listJobs
Section titled “listJobs”const result = await lt.exports.listJobs({ app_id: 'durable', limit: 25, offset: 0, status: 'completed' });List workflow jobs in a namespace with filtering, sorting and pagination.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
app_id |
string |
Yes | Namespace to list |
limit |
number |
No | Max jobs to return |
offset |
number |
No | Jobs to skip |
entity |
string |
No | Filter by entity (workflow type) |
search |
string |
No | Free-text search across job fields |
status |
string |
No | Filter by job status |
sort_by |
string |
No | Field to sort by |
order |
string |
No | asc or desc |
registered |
string |
No | Filter by registration status |
Returns: LTApiResult<{ jobs, total, ... }>
Auth: Not required.
exportState
Section titled “exportState”const result = await lt.exports.exportState({ workflowId: 'wf_abc123', allow: ['data', 'status'], values: true,});Export a workflow’s stored state. Filter fields with allow and block.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
workflowId |
string |
Yes | Workflow ID |
allow |
LTExportField[] |
No | Fields to include |
block |
LTExportField[] |
No | Fields to exclude |
values |
boolean |
No | Include field values, not just names |
LTExportField is one of 'data', 'state', 'status', 'timeline', 'transitions'.
Returns: LTApiResult<ExportedState>. 404 if the workflow is not found or its data has expired.
Auth: Not required.
exportExecution
Section titled “exportExecution”const result = await lt.exports.exportExecution({ workflowId: 'wf_abc123', excludeSystem: true,});Export a workflow’s full execution tree, including activity inputs and results.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
workflowId |
string |
Yes | Workflow ID |
excludeSystem |
boolean |
No | Leave out system-generated activities |
omitResults |
boolean |
No | Leave out activity result payloads |
mode |
ExportMode |
No | Output format |
maxDepth |
number |
No | Max depth to traverse |
Returns: LTApiResult<ExecutionExport>. 404 if the workflow is not found or its data has expired.
Auth: Not required.
getStatus
Section titled “getStatus”const result = await lt.exports.getStatus({ workflowId: 'wf_abc123' });Get a workflow’s current status.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
workflowId |
string |
Yes | Workflow ID |
Returns: LTApiResult<{ workflow_id, status, state, terminated }>: the numeric HotMesh status, the state (running, completed or failed) and terminated. 404 if the workflow is not found or its data has expired.
Auth: Not required.
getState
Section titled “getState”const result = await lt.exports.getState({ workflowId: 'wf_abc123' });Get a workflow’s current state data.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
workflowId |
string |
Yes | Workflow ID |
Returns: LTApiResult<WorkflowState>. 404 if the workflow is not found or its data has expired.
Auth: Not required.
