Skip to main content

WithTaskID

Gets a new context with WorkflowName set.

def WithTaskID(
ctx: context.Context,
taskID: string
) - > context.Context

Gets a new context with WorkflowName set. This function is used to associate a specific task ID with a context, allowing subsequent operations within that context to be linked to the task.

Parameters

NameTypeDescription
ctxcontext.ContextThe parent context to which the task ID will be added.
taskIDstringThe unique identifier for the task to be associated with the context.

Returns

TypeDescription
context.ContextA new context derived from the input context, with the provided task ID associated.