Skip to content

Commit

Permalink
IWF-356: Fix child_workflow_request_id
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolczynski committed Dec 3, 2024
1 parent 77974a4 commit 4e8ba15
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions iwf/workflow_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ class WorkflowContext:


def _from_idl_context(idl_context: Context) -> WorkflowContext:
state_execution_id = unset_to_none(idl_context.state_execution_id)

return WorkflowContext(
workflow_id=idl_context.workflow_id,
workflow_run_id=idl_context.workflow_run_id,
workflow_start_timestamp_seconds=idl_context.workflow_started_timestamp,
state_execution_id=unset_to_none(idl_context.state_execution_id),
state_execution_id=state_execution_id,
first_attempt_timestamp_seconds=unset_to_none(
idl_context.first_attempt_timestamp,
),
attempt=unset_to_none(idl_context.attempt),
child_workflow_request_id=unset_to_none(idl_context.workflow_run_id)
+ "-"
+ unset_to_none(idl_context.state_execution_id),
child_workflow_request_id=(
idl_context.workflow_run_id + "-" + state_execution_id
if state_execution_id is not None
else None
),
)

0 comments on commit 4e8ba15

Please sign in to comment.