Skip to content

Handle case where in_workflow is called in a synchronous activity #884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 5, 2025

Conversation

tconley1428
Copy link
Contributor

What was changed

Catch runtime error if asynio loop doesn't exist, returning False in workflow.in_workflow

Why?

Result of workflow.in_workflow should be available inside sync activities

Checklist

  1. Closes [Bug] workflow.in_workflow() expects to be called in a thread with a running event loop #878

  2. How was this tested:
    New workflow test

  3. Any docs updates needed?

@tconley1428 tconley1428 requested a review from a team as a code owner June 4, 2025 18:59
@tconley1428 tconley1428 merged commit 316a528 into main Jun 5, 2025
15 checks passed
@tconley1428 tconley1428 deleted the in_workflow_sync branch June 5, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] workflow.in_workflow() expects to be called in a thread with a running event loop
2 participants