Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(tasks): reliably start the Slack agent-design relay child workflow (#67756)

Vojta Bartošee63daa4415f
diff --git a/products/tasks/backend/temporal/process_task/workflow.py b/products/tasks/backend/temporal/process_task/workflow.py
index 5199ba70b3aa..615f109acee8 100644
--- a/products/tasks/backend/temporal/process_task/workflow.py
+++ b/products/tasks/backend/temporal/process_task/workflow.py
@@ -1188,18 +1188,16 @@ class ProcessTaskWorkflow(PostHogWorkflow):
return
relay_workflow_id = f"slack-agent-design-relay-{self.context.run_id}-{workflow.uuid4()}"
self._current_slack_relay_workflow_id = relay_workflow_id
- asyncio.ensure_future(
- workflow.execute_child_workflow(
- SlackAgentDesignRelayWorkflow.run,
- SlackAgentDesignRelayInput(slack_thread_context=slack_ctx),
- id=relay_workflow_id,
- task_queue=workflow.info().task_queue,
- # Cancel on parent close so the relay's finally block runs
- # stop_slack_agent_design_stream — otherwise the plan-block
- # stream is orphaned until Slack's own GC.
- parent_close_policy=ParentClosePolicy.REQUEST_CANCEL,
- execution_timeout=timedelta(hours=1),
- )
+ await workflow.start_child_workflow(
+ SlackAgentDesignRelayWorkflow.run,
+ SlackAgentDesignRelayInput(slack_thread_context=slack_ctx),
+ id=relay_workflow_id,
+ task_queue=workflow.info().task_queue,
+ # Cancel on parent close so the relay's finally block runs
+ # stop_slack_agent_design_stream — otherwise the plan-block
+ # stream is orphaned until Slack's own GC.
+ parent_close_policy=ParentClosePolicy.REQUEST_CANCEL,
+ execution_timeout=timedelta(hours=1),
)
@temporalio.workflow.signal