<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Workflow on Dapr Docs</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/</link><description>Recent content in Workflow on Dapr Docs</description><generator>Hugo</generator><language>en</language><atom:link href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/index.xml" rel="self" type="application/rss+xml"/><item><title>Workflow overview</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/</guid><description>&lt;p>Dapr workflow makes it easy for developers to write business logic and integrations in a reliable way.
Since Dapr workflows are stateful, they support long-running and fault-tolerant applications, ideal for orchestrating microservices.
Dapr workflow works seamlessly with other Dapr building blocks, such as service invocation, pub/sub, state management, and bindings.&lt;/p>
&lt;p>The durable, resilient Dapr Workflow capability:&lt;/p>
&lt;ul>
&lt;li>Offers a built-in workflow runtime for driving Dapr Workflow execution.&lt;/li>
&lt;li>Provides SDKs for authoring workflows in code, using any language.&lt;/li>
&lt;li>Provides HTTP and gRPC APIs for managing workflows (start, query, pause/resume, raise event, terminate, purge).&lt;/li>
&lt;/ul>
&lt;img src="https://v1-18.docs.dapr.io/images/workflow-overview/workflow-overview.png" width=800 alt="Diagram showing basics of Dapr Workflow">
&lt;p>Some example scenarios that Dapr Workflow can perform are:&lt;/p></description></item><item><title>Features and concepts</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-features-concepts/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-features-concepts/</guid><description>&lt;p>Now that you&amp;rsquo;ve learned about the &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/">workflow building block&lt;/a> at a high level, let&amp;rsquo;s deep dive into the features and concepts included with the Dapr Workflow engine and SDKs. Dapr Workflow exposes several core features and concepts which are common across all supported languages.&lt;/p>


&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>

 For more information on how workflow state is managed, see the &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-architecture/">workflow architecture guide&lt;/a>.

&lt;/div>

&lt;h2 id="workflows">Workflows&lt;/h2>
&lt;p>Dapr Workflows are functions you write that define a series of tasks to be executed in a particular order.
The Dapr Workflow engine takes care of scheduling and execution of the tasks, including managing failures and retries.
If the app hosting your workflows is scaled out across multiple machines, the workflow engine load balances the execution of workflows and their tasks across multiple machines.&lt;/p></description></item><item><title>Workflow versioning</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-versioning/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-versioning/</guid><description>&lt;h2 id="versioning">Versioning&lt;/h2>
&lt;p>There are many scenarios where it is necessary to introduce changes to workflow code while workflows are actively
running. In cases where these changes are non-deterministic, a versioning strategy is required so that existing
workflows can continue executing with the original code, while new workflows use the updated version.&lt;/p>
&lt;p>Workflows can be versioned using two complementary approaches and it&amp;rsquo;s intended that both are used in
conjunction with one another. These are:&lt;/p></description></item><item><title>Workflow patterns</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-patterns/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-patterns/</guid><description>&lt;p>Dapr Workflows simplify complex, stateful coordination requirements in microservice architectures. The following sections describe several application patterns that can benefit from Dapr Workflows.&lt;/p>
&lt;h2 id="task-chaining">Task chaining&lt;/h2>
&lt;p>In the task chaining pattern, multiple steps in a workflow are run in succession, and the output of one step may be passed as the input to the next step. Task chaining workflows typically involve creating a sequence of operations that need to be performed on some data, such as filtering, transforming, and reducing.&lt;/p></description></item><item><title>Workflow architecture</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-architecture/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-architecture/</guid><description>&lt;p>&lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/">Dapr Workflows&lt;/a> allow developers to define workflows using ordinary code in a variety of programming languages. The workflow engine runs inside of the Dapr sidecar and orchestrates workflow code deployed as part of your application. Dapr Workflows are built on top of Dapr Actors providing durability and scalability for workflow execution.&lt;/p>
&lt;p>This article describes:&lt;/p>
&lt;ul>
&lt;li>The architecture of the Dapr Workflow engine&lt;/li>
&lt;li>How the workflow engine interacts with application code&lt;/li>
&lt;li>How the workflow engine fits into the overall Dapr architecture&lt;/li>
&lt;li>How different workflow backends can work with workflow engine&lt;/li>
&lt;/ul>
&lt;p>For more information on how to author Dapr Workflows in your application, see &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/">How to: Author a workflow&lt;/a>.&lt;/p></description></item><item><title>How to: Author a workflow</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/howto-author-workflow/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/howto-author-workflow/</guid><description>&lt;p>This article provides a high-level overview of how to author workflows that are executed by the Dapr Workflow engine.&lt;/p>


&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>

 If you haven&amp;rsquo;t already, &lt;a href="https://v1-18.docs.dapr.io/getting-started/quickstarts/workflow-quickstart/">try out the workflow quickstart&lt;/a> for a quick walk-through on how to use workflows.

&lt;/div>

&lt;h2 id="author-workflows-as-code">Author workflows as code&lt;/h2>
&lt;p>Dapr Workflow logic is implemented using general purpose programming languages, allowing you to:&lt;/p>
&lt;ul>
&lt;li>Use your preferred programming language (no need to learn a new DSL or YAML schema).&lt;/li>
&lt;li>Have access to the language’s standard libraries.&lt;/li>
&lt;li>Build your own libraries and abstractions.&lt;/li>
&lt;li>Use debuggers and examine local variables.&lt;/li>
&lt;li>Write unit tests for your workflows, just like any other part of your application logic.&lt;/li>
&lt;/ul>
&lt;p>The Dapr sidecar doesn’t load any workflow definitions. Rather, the sidecar simply drives the execution of the workflows, leaving all the workflow activities to be part of the application.&lt;/p></description></item><item><title>How to: Manage workflows</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/howto-manage-workflow/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/howto-manage-workflow/</guid><description>&lt;p>Now that you&amp;rsquo;ve &lt;a href="https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/howto-author-workflow/">authored the workflow and its activities in your application&lt;/a>, you can start, terminate, rerun, and get information about the workflow using the CLI or API calls.&lt;/p>


&lt;!--CLI-->


&lt;!--Python-->


&lt;!--JavaScript-->


&lt;!--NET-->


&lt;!--Java-->


&lt;!--Go-->


&lt;!--HTTP-->


&lt;ul class="nav nav-tabs" id="tabs-1" role="tablist">
 &lt;li class="nav-item">
 &lt;button class="nav-link active"
 id="tabs-01-00-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-00" role="tab"
 data-td-tp-persist="cli" aria-controls="tabs-01-00" aria-selected="true">
 CLI
 &lt;/button>
 &lt;/li>&lt;li class="nav-item">
 &lt;button class="nav-link"
 id="tabs-01-01-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-01" role="tab"
 data-td-tp-persist="python" aria-controls="tabs-01-01" aria-selected="false">
 Python
 &lt;/button>
 &lt;/li>&lt;li class="nav-item">
 &lt;button class="nav-link"
 id="tabs-01-02-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-02" role="tab"
 data-td-tp-persist="javascript" aria-controls="tabs-01-02" aria-selected="false">
 JavaScript
 &lt;/button>
 &lt;/li>&lt;li class="nav-item">
 &lt;button class="nav-link"
 id="tabs-01-03-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-03" role="tab"
 data-td-tp-persist=".net" aria-controls="tabs-01-03" aria-selected="false">
 .NET
 &lt;/button>
 &lt;/li>&lt;li class="nav-item">
 &lt;button class="nav-link"
 id="tabs-01-04-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-04" role="tab"
 data-td-tp-persist="java" aria-controls="tabs-01-04" aria-selected="false">
 Java
 &lt;/button>
 &lt;/li>&lt;li class="nav-item">
 &lt;button class="nav-link"
 id="tabs-01-05-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-05" role="tab"
 data-td-tp-persist="go" aria-controls="tabs-01-05" aria-selected="false">
 Go
 &lt;/button>
 &lt;/li>&lt;li class="nav-item">
 &lt;button class="nav-link"
 id="tabs-01-06-tab" data-bs-toggle="tab" data-bs-target="#tabs-01-06" role="tab"
 data-td-tp-persist="http" aria-controls="tabs-01-06" aria-selected="false">
 HTTP
 &lt;/button>
 &lt;/li>
&lt;/ul>

&lt;div class="tab-content" id="tabs-1-content">
 &lt;div class="tab-body tab-pane fade show active"
 id="tabs-01-00" role="tabpanel" aria-labelled-by="tabs-01-00-tab" tabindex="1">
 &lt;h2 id="managing-workflows-with-the-dapr-cli">Managing Workflows with the Dapr CLI&lt;/h2>
&lt;p>The Dapr CLI provides commands for managing workflow instances in both self-hosted and Kubernetes environments.&lt;/p></description></item><item><title>Multi Application Workflows</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-multi-app/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-multi-app/</guid><description>&lt;p>It is often the case that a single workflow spans multiple applications, microservices, or programming languages.
This is where an activity or a child workflow will be executed on a different application than the one hosting the parent workflow.&lt;/p>
&lt;p>Some scenarios where this is useful include:&lt;/p>
&lt;ul>
&lt;li>A Machine Learning (ML) training activity must be executed on GPU-enabled machines, while the rest of the workflow runs on CPU-only orchestration machines.&lt;/li>
&lt;li>Activities need access to sensitive data or credentials that are only available to particular identities or locales.&lt;/li>
&lt;li>Different parts of the workflow need to be executed in different trust zones or networks.&lt;/li>
&lt;li>Different parts of the workflow need to be executed in different geographic regions due to data residency requirements.&lt;/li>
&lt;li>An involved business process spans multiple teams or departments, each owning their own application.&lt;/li>
&lt;li>Implementation of a workflow spans different programming languages based on team expertise or existing codebases.&lt;/li>
&lt;li>Different team boundaries or microservice ownership.&lt;/li>
&lt;/ul>
&lt;img src="https://v1-18.docs.dapr.io/images/workflow-overview/workflow-multi-app-complex.png" width=800 alt="Diagram showing multi-application complex workflow">
&lt;p>The diagram below shows an example scenario of a complex workflow that orchestrates across multiple applications that are written in different languages. Each applications&amp;rsquo; main steps and activities are:&lt;/p></description></item><item><title>History Retention Policy</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-history-retention-policy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-history-retention-policy/</guid><description>&lt;p>Dapr workflow state is stored in the [actor state store]{{ %ref workflow-architecture.md#state-store-usage %}}.
By default, Dapr Workflows retains the complete history of workflow state changes indefinitely.
This means historical workflows can be queried and inspected at any time.
Running many workflows or workflows which generate large amounts of state change history can lead to increased storage usage, which can eventually fill up the state store disk space.&lt;/p>
&lt;p>To help manage storage usage, Dapr Workflows supports configuring a history retention policy.
The retention policy defines how long to retain workflow state change history before it is deleted.
Workflows will only be eligible for deletion once it has reached a &lt;strong>terminal state&lt;/strong> (&lt;code>Completed&lt;/code>, &lt;code>Failed&lt;/code>, or &lt;code>Terminated&lt;/code>).
Each workflow &lt;strong>terminal state&lt;/strong> can have a custom retention duration, as well as a default retention duration for any terminal states not explicitly configured.
The duration is defined as a &lt;a href="https://pkg.go.dev/time#ParseDuration">Go duration string&lt;/a> (for example, &lt;code>72h&lt;/code> for 72 hours, or &lt;code>30m&lt;/code> for 30 minutes).&lt;/p></description></item><item><title>Workflow Execution Concurrency</title><link>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-concurrency/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/building-blocks/workflow/workflow-concurrency/</guid><description>&lt;p>You can configure the maximum concurrent workflows and activities that can be executed at any one time with the following configuration.
These limits are imposed on a &lt;em>per&lt;/em> sidecar basis, meaning that if you have 10 replicas of your workflow app, the effective limit is 10 times the configured value.&lt;/p>
&lt;p>Setting these limits can help prevent resource exhaustion on your Dapr sidecar and application, or to drain down a backlog of workflows if there had been a spike in activity causing resource contention.
These limits do not distinguish between different workflow or activity definitions, so they apply to all workflows and activities running in the sidecar.&lt;/p></description></item></channel></rss>