Skip to content

Commit bf045f0

Browse files
committed
docs: tighten execute() docstring
1 parent 4c9cc8c commit bf045f0

1 file changed

Lines changed: 11 additions & 24 deletions

File tree

src/conductor/client/workflow/executor/workflow_executor.py

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -91,33 +91,20 @@ def execute_workflow_with_return_strategy(self, request: StartWorkflowRequest, w
9191
def execute(self, name: str, version: Optional[int] = None, workflow_input: Any = None,
9292
wait_until_task_ref: Optional[str] = None, wait_for_seconds: int = 10,
9393
request_id: Optional[str] = None, correlation_id: Optional[str] = None, domain: Optional[str] = None) -> WorkflowRun:
94-
"""Execute a workflow synchronously and return the result.
94+
"""Execute a workflow synchronously and wait for it to complete.
9595
96-
Blocks until the workflow reaches a terminal state (COMPLETED, FAILED, TIMED_OUT,
97-
TERMINATED) or until ``wait_for_seconds`` elapses, whichever comes first. If the
98-
timeout fires first, returns a ``WorkflowRun`` with ``status='RUNNING'`` and empty
99-
output — this is normal behavior, not an error.
96+
Returns when the workflow reaches a terminal state or ``wait_for_seconds`` elapses.
97+
If the timeout fires first, returns ``status='RUNNING'`` with empty output — not an error.
10098
101-
**Common gotcha — RUNNING with no output after a worker exception:**
102-
The default ``wait_for_seconds=10`` is shorter than the default task
103-
``retryDelaySeconds=60``. If your worker raises an exception, Conductor marks the task
104-
FAILED and schedules a retry after 60 s. The 10 s wait expires while the retry is
105-
pending, so you see ``status='RUNNING'``. Increase ``wait_for_seconds`` to outlast the
106-
full retry cycle (e.g. ``wait_for_seconds=70`` for one retry with the default delay).
99+
**Getting RUNNING back?** The default ``wait_for_seconds=10`` is shorter than the
100+
default task ``retryDelaySeconds=60``. A failing worker triggers a 60 s retry wait,
101+
so the 10 s timeout fires while the retry is pending. Raise ``wait_for_seconds``
102+
(e.g. 70) or inspect failed tasks::
107103
108-
**Debugging a RUNNING result:**
109-
110-
- Open the Conductor UI at ``<server>/execution/<workflow_id>`` — the UI shows task
111-
failures and worker exception messages directly.
112-
- Fetch task details programmatically::
113-
114-
wf = executor.get_workflow(run.workflow_id, include_tasks=True)
115-
for task in wf.tasks:
116-
if task.status in ('FAILED', 'FAILED_WITH_TERMINAL_ERROR'):
117-
print(task.reference_task_name, task.reason_for_incompletion)
118-
119-
- Check ``TaskHandler`` / worker process logs for the Python traceback. Worker
120-
exceptions are logged at ERROR level by the SDK before the task result is reported.
104+
wf = executor.get_workflow(run.workflow_id, include_tasks=True)
105+
for task in wf.tasks:
106+
if task.status in ('FAILED', 'FAILED_WITH_TERMINAL_ERROR'):
107+
print(task.reference_task_name, task.reason_for_incompletion)
121108
"""
122109
workflow_input = workflow_input or {}
123110
if request_id is None:

0 commit comments

Comments
 (0)