getWorkflowMetadata
Returns additional metadata available in the current workflow function.
You may want to use this function when you need to:
- Log workflow run IDs
- Access timing information of a workflow
If you need to access step context, take a look at getStepMetadata.
import { getWorkflowMetadata } from "workflow"
async function testWorkflow() {
"use workflow"
const ctx = getWorkflowMetadata()
console.log(ctx.workflowRunId)
}API Signature
Parameters
This function does not accept any parameters.
Returns
| Name | Type | Description |
|---|---|---|
workflowRunId | string | Unique identifier for the workflow run. |
workflowStartedAt | Date | Timestamp when the workflow run started. |
url | string | The URL where the workflow can be triggered. |