I’m running a Temporal Python worker in debug mode (PyCharm), and I’m able to hit breakpoints inside @activity.defn
methods without any issues. However, breakpoints inside the @workflow.run
method do not trigger at all, even though:
- The workflow code is definitely executing (I see print() output)
- The worker is running in the same process under the debugger
- I am starting the workflow using await client.execute_workflow(…) from pycharm as well, using debug mode.
- using latest temporal
- all this is running on my macbook pro (local dev machine)
- and set debug_mode when creating the worker.
worker = Worker(
client,
.....
debug_mode=True,
)
@workflow.defn
class MyScanner:
@workflow.run
async def run(self) -> None:
print("Entered run") # This shows up in logs
# none of the breakpoints below triggers.
if <...>:
What I’ve tried:
- Verified PyCharm is in debug mode (confirmed by breakpoints hitting in activities)
- Tried restarting workflow execution with new workflow_id to avoid replay. also restarted temporal, pycharm
- Confirmed print() calls inside run() do show output
- I also set TEMPORAL_DEBUG=true as an environment variable (its outputting as true in the worker logs), but nothing changes.
Question:
- Why aren’t breakpoints working in @workflow.run despite everything running in-process? Is this a limitation of the Temporal Python SDK’s? Any known workarounds?