Azure / Azure/azure-functions-agents-runtime

Support async workflow tool handlers

Open
#139 0 comments 0 reactions 0 assignees View on GitHub
area:serverless-agents feature request
Dominant language
Python
Stars
9
Forks
7
Avg merge
1d 21h
Merged PRs (30d)
20

Description

> Please provide us with the following information:
> ---------------------------------------------------------------

### This issue is for a: (mark with an `x`)
```
- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
> 1. Define an `async def` handler decorated with `@workflow_tool` in `tools/*.py`.
> 2. Enable Dynamic Workflows and generate a workflow that invokes the handler.
> 3. Observe that Dynamic Workflows v1 only supports synchronous workflow tool handlers.

### Any log messages given by the failure
> N/A. The current limitation is documented: workflow tool handlers must be synchronous, accept one dictionary argument, and return a JSON-serializable value.

### Expected/desired behavior
> `@workflow_tool` should support both synchronous and asynchronous handlers. The Activity runner should await asynchronous results while preserving the existing behavior for synchronous handlers, input validation, JSON-serializability checks, retries, timeouts, and sanitized failure reporting.

### OS and Version?
> All supported platforms.

### Versions
> Dynamic Workflows v1 / PR #117.

### Mention any other details that might be useful

> This is a limitation of the runtime's current workflow tool registry and Activity runner, not a Durable Functions requirement. Removing it will allow workflow tools to call asynchronous SDKs and other I/O-bound APIs without synchronous wrappers.
>
> Suggested acceptance criteria:
> - Discover and register synchronous and asynchronous `@workflow_tool` handlers.
> - Await asynchronous handlers in the workflow Activity runner; continue invoking synchronous handlers without behavior changes.
> - Preserve the single-dictionary input contract and JSON-serializable output validation.
> - Preserve existing timeout, retry, logging, and sanitized error semantics.
> - Add unit and end-to-end coverage for synchronous success, asynchronous success, asynchronous failure, timeout, and non-JSON-serializable results.
> - Update the workflow authoring and runtime documentation to remove the synchronous-only restriction.
>
> Follow-up from the review discussion in PR #117. This is separate from #109, which tracks removing the `main.agent.md` ownership restriction.

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.

Contributor guide

Open the contributing guide

Research direction

Start with the workflow tool registry and Activity runner described in PR #117, then inspect the handlers under tools/*.py. Review the existing workflow authoring and runtime documentation and current coverage before making changes. Done means synchronous and asynchronous handlers work with the stated validation, retry, timeout, error, and serialization behavior, with unit, end-to-end, and documentation coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
backend, documentation, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.