Durable Functions (an extension of Azure Functions and Azure WebJobs) enables writing long-running, stateful function orchestrations in code in a serverless environment (PaaS options and self-hosting are also supported).
This extension enables a new type of function called the orchestrator function that allows you to do several new things that differentiates it from an ordinary, stateless function:
- They are stateful workflows authored in code. No JSON schemas or designers.
- They can synchronously and asynchronously call other functions and save output to local variables.
- They automatically checkpoint their progress whenever the function awaits so that local state is never lost if the process recycles or the VM reboots.
The Durable Functions extension currently ships as the Microsoft.Azure.WebJobs.Extensions.DurableTask NuGet package that can be referenced by an Azure Functions Visual Studio project.
Are you new to Durable Functions? If so, this is the place to start.
Here are some samples you can study and/or reference. These will help you 1) learn how to write Durable Functions by example and 2) learn the various capabilities of Durable Functions.
- Function Chaining - Hello sequence
- Fan-out/Fan-in - Cloud backup
- Monitors - Weather watcher
- Human interaction & timeouts - Phone verification
- Unit testing - xUnit & Moq
- Self hosting - WebJob SDK integration
- Lifecycle event notifications - Azure Event Grid
Using one of the sample projects is a great way to get up and running quickly and is the recommended way to get started. See the sample / walkthrough links above for specific instructions.
Or if you prefer to start diving into the sample code, there are samples available for several development platforms:
- C# for Visual Studio, including unit test samples
- C# scripts
- C# for Azure WebJobs
- F#
- JavaScript (Functions v2 only)
Here you will find comprehensive documentation with examples on all of the feature areas. It's highly recommended that you read through all of these topics before coding.
- Bindings
- Checkpointing & replay
- Custom orchestration status
- Instance management
- HTTP APIs
- Error handling & compensation
- Diagnostics
- Durable timers
- External events
- Eternal orchestrations
- Singleton orchestrations
- Sub-orchestrations
- Task hubs
- Versioning
- Performance & scale
- Disaster recovery and geo-distribution
You can browse all of our public .NET APIs here. JavaScript API reference docs are coming soon!
We welcome outside contributions. If you are interested in contributing, please take a look at our CONTRIBUTING guide.
This project is under the benevolent umbrella of the .NET Foundation and is licensed under the MIT License
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.