Skip to content

Pass previous result to child workflows in Chain(send_result=True) on SWF - #489

Open
chenyangsu wants to merge 1 commit into
botify-labs:mainfrom
chenyangsu:fix/chain-send-result-workflow-task
Open

chenyangsu wants to merge 1 commit into
botify-labs:mainfrom
chenyangsu:fix/chain-send-result-workflow-task

Conversation

@chenyangsu

Copy link
Copy Markdown

In Chain(..., send_result=True) on SWF, ChainFuture appends previous_result to a.args for a child WorkflowTask, while swf.task.WorkflowTask.from_generic_task reads task._args. For Chain((to_int, "42"), ChildWorkflowTask(Child, "prefix"), send_result=True), the StartChildWorkflowExecution decision sends {"args": ["prefix"], "kwargs": {}} without 42 and keeps the initial workflowId from get_workflow_id.

Rebuilding WorkflowTask in ChainFuture.__init__ mirrors the ActivityTask branch from #247 while keeping workflow_task_list and task-level attributes. Happy to handle this in from_generic_task instead if you prefer.

Testing: pytest tests/test_simpleflow/test_canvas.py -> 22 passed, 2 subtests passed (new test fails on main), pytest tests/test_simpleflow/ tests/integration/test_canvas.py -> 378 passed, 10 skipped, 3 xfailed, ruff check clean.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant