steps/runtime
Read run context and update run resources outside workflow code.
Wrap steps in a factory-owned "use step" file. Never call them directly from a workflow.
Functions
createRunDirectory()
function createRunDirectory(metadata): Promise<string>;Create a working directory that survives retries and pauses in this run.
Parameters
| Parameter | Type |
|---|---|
metadata | RunMetadata |
Returns
Promise<string>
dashboardRunUrl()
function dashboardRunUrl(runId): string | undefined;The run's page on the dashboard this service hosts, or undefined when the service was started without one. Never a standalone workflow web URL: run against a live World it opens a second queue worker and steals the jobs the run is waiting on.
Parameters
| Parameter | Type |
|---|---|
runId | string |
Returns
string | undefined
registerResource()
function registerResource(resource): Promise<RunResource>;Register one resource on the active run.
Repeating kind + identity is idempotent. A new URL for that identity replaces the old URL; concurrent updates are last-committed-wins. Distinct identities occupy distinct atomic keys.
Parameters
| Parameter | Type |
|---|---|
resource | RunResource |
Returns
Promise<RunResource>
releaseRunResources()
function releaseRunResources(policy, metadata): Promise<ReleaseReport>;Persist an explicit success action, release under the run lock and return the result.
Parameters
| Parameter | Type | Description |
|---|---|---|
policy | { onFailure: "release" | "keep"; onSuccess: "release" | "keep"; } | - |
policy.onFailure | "release" | "keep" | What to do with eligible resources after a failed or cancelled run. |
policy.onSuccess | "release" | "keep" | What to do with eligible resources after a completed run. |
metadata | RunMetadata | - |
Returns
Promise<ReleaseReport>
removeRunDirectory()
function removeRunDirectory(metadata): Promise<void>;Remove this run's working directory after its work is finished, never while paused.
Parameters
| Parameter | Type |
|---|---|
metadata | RunMetadata |
Returns
Promise<void>
resolveReleasePolicy()
function resolveReleasePolicy(metadata, definition): Promise<{
onFailure: "release" | "keep";
onSuccess: "release" | "keep";
}>;Resolve the workflow policy, then the factory policy, then the built-in release/keep default.
Parameters
| Parameter | Type |
|---|---|
metadata | NamedRunMetadata |
definition | FactoryDefinition |
Returns
Promise<{ onFailure: "release" | "keep"; onSuccess: "release" | "keep"; }>