Skip to content

feat: add workflowRunCreatedAt to context and pass it in invoke requests#178

Open
CahidArda wants to merge 1 commit intomainfrom
DX-2386-pass-createdAt-in-invoke
Open

feat: add workflowRunCreatedAt to context and pass it in invoke requests#178
CahidArda wants to merge 1 commit intomainfrom
DX-2386-pass-createdAt-in-invoke

Conversation

@CahidArda
Copy link
Collaborator

@CahidArda CahidArda commented Feb 4, 2026

We pass the workflow created at to uniquely identify the invoker workflow. This will allow us to update the invoker workflow if the invoked workflow fails.

@linear
Copy link

linear bot commented Feb 4, 2026

Copy link
Collaborator Author

@CahidArda CahidArda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding some comments to help @mehmettokgoz review

/**
* Creation time of the workflow run
*/
public readonly workflowRunCreatedAt: number;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new workflowRunCreatedAt field in context

telemetry,
invokeCount,
label,
workflowRunCreatedAt: Number(workflowRunCreatedAt),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we assign the value to context as number, not string

[]
[],
{
[WORKFLOW_CREATED_AT_HEADER]: workflowCreatedAt,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the incoming request has a WORKFLOW_CREATED_AT_HEADER (Upstash-Workflow-CreatedAt), there is workflowCreatedAt in the request when we invoke. Note that it's a number in the invoke payload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant