back to blog & resources
Blog

Bilgin Ibryam

|

September 11, 2025

Authoring Workflows in the Age of AI with Dapr

Durable workflows meet generative AI: go from sketch to running code, and even let agents build workflows on the fly. Learn three practical approaches for creating Dapr workflows with AI, ranging from full control to full autonomy.

Dapr workflows offer durability, resiliency, and predictability to business‑critical applications. With AI in the developers’ toolkit, there is now an even faster path to design and implement workflows and bring these benefits to all kinds of applications. In this post, I’ll discuss three approaches to creating Dapr workflows, from AI copilots to visual designers to agentic workflows.

AI-Assisted Workflow Coding

Traditionally, building workflows meant opening your IDE and hand-coding all the workflow logic. Dapr makes this a bit simpler with its code-first workflow definition model, letting developers define workflows directly in their language of choice.

Cursor generating a Dapr workflow

With generative AI–assisted tools, this process can be sped up significantly. For example, Cursor is an AI-powered IDE with both autocomplete and agentic features. It can help with small tasks such as implementing individual workflow steps, or go as far as generating an entire workflow definition or even a full end-to-end app. Other tools, like Claude Code, are CLI-based and can also generate workflow applications.

  • Best for: Experienced developers who want full control and flexibility when building complex workflows. The AI can generate code in small or large increments, while developers review, modify, or reject the output.
  • Tradeoff: Current AI tools have real limitations: they hallucinate often and their knowledge is stale. Without guidance, the code they generate will not be reliable.

If you want to use this approach today, here’s the starting point: always feed the AI with context. For Dapr, that means providing links to the latest Dapr docs, quickstarts, SDK references (for example, Python SDK), and working code samples in your language of choice. These inputs drastically improve the quality of generated code.

The challenge is that every tool has its own way of passing this context. Cursor uses project rules, Claude relies on a CLAUDE.md file, and there are emerging attempts like Agents.md to standardize this. Pick the method that works best for your environment.

While AI-assisted tools can accelerate workflow development, they won’t replace your judgment. Think of them as accelerators, not autopilots. In a future article, I’ll share concrete steps and examples of how to set up these tools effectively for Dapr workflows.

Diagrams to Workflow Generation

Workflow is essentially a business process that can be represented visually with boxes, arrows, and decision points. Most teams begin by sketching their projects on paper or using a graphical notation such as BPMN, meaning developers often start from an existing diagram. With AI now able to process images as well as text, turning these diagrams into workflow specifications becomes a very natural and attractive approach.

Diagrid Workflow Composer takes this idea further. It is an AI-powered service that converts workflow diagrams into ready-to-run Dapr applications. You draw or upload a diagram (drawn in tools like draw.io, Lucidchart, or BPMN) and Composer analyzes the tasks and relationships, then generates a complete Dapr workflow project in your chosen language (.NET, Java, Python, JavaScript, Go). The output is a complete, scaffolded Dapr project, including workflow definitions, activity placeholders, build files, and Dapr configuration, all ready to run with 'dapr run'.

Workflow Composer diagram to code

This way, you move from a napkin sketch to runnable code in minutes, without manually writing every workflow step. Once you export the code, you can extend and modify it as needed.

  • Best for: developers and architects starting from a napkin sketch, quickly building a PoC from a diagram, or migrating existing process diagrams into Dapr workflows.
  • Tradeoff: much faster and more reliable for the initial step, but the generated code cannot be iterated upon inside the tool today. You have to take it into your IDE (possibly AI-enabled one as described above) to extend and maintain further.

👉 Ready to try it? Head to workflows.diagrid.io, sign up, and sketch your first workflow project. In just a few minutes, you’ll have a runnable Dapr workflow application in your desired language ready to run. It’s free to use, with up to 5 generations per day.

Dynamic Agentic Workflows

Traditional workflows, whether written manually or with some AI assistance, predefine a static sequence of tasks. Each step follows a fixed order, and decision logic is limited to rules baked into the process. This model has limitations: it doesn’t adapt well to changing conditions, and it struggles with incomplete or ambiguous input without redesigning the workflow.

Agentic workflows change that. With AI’s ability to reason, make decisions, and act (ReAct), AI agents can create workflows dynamically. Instead of defining every step deterministically, the developer gives the agent a goal and instructions in the form of a prompt. At runtime, the agent interprets the prompt, decides the next step based on context and goal, and executes until the goal is accomplished. Dapr Agents does exactly that: its 'DurableAgent' creates workflows on the fly to make all interactions of the Agent reliable and durable.

Defining an agent using Dapr Agents

This means the workflow structure is not fixed, it is decided by the LLM at runtime. The agent can recover from failure, optimize the path, and adapt dynamically. You still provide a minimal static skeleton in code, but the actual workflow plan and execution path are generated at runtime.

  • Best for: when business logic is fluid, and you want to give more autonomy and agency to AI by specifying tasks in natural language prompts.
  • Tradeoff: less control and less predictability, but greater ability to handle variability. The workflow itself is completely hidden and non-deterministic, the LLM decides what to do and in what step at runtime.

👉 Want to try it out? Head to the Dapr Agents Quickstarts and launch your first agentic workflow today.

Visualizing Workflows

Regardless of how a workflow is defined, visibility into its execution at runtime is crucial. Visualization brings transparency, making agent decisions and task flows visible so outcomes don’t feel like a black box. It helps with debugging, identifying failures, bottlenecks, or unexpected paths. It exposes inefficiencies, redundant steps, or unnecessary loops that can be improved. Most importantly, users and stakeholders are more likely to trust systems they can see and understand.

Diagrid Catalyst visualizing workflow execution steps

Diagrid Catalyst provides deep visibility into workflow execution extracted directly from runtime. You can see each step taken, inputs and outputs for every task, execution times, failures, and successes, all in close to real-time.

👉 Curious to see how your workflow looks at runtime? Head to Diagrid Catalyst, sign up, and deploy your workflow applications. It’s free to use with a generous tier.


Conclusion

In the age of AI, the core value proposition of a workflow engine remains unchanged: reliability, durability, and the ability to handle long-running processes. What is changing is how we achieve it and how much more accessible workflows have become.

The Workflow Control–Agency Curve

Today, we can:

  • Define each step manually (or with some AI assistance), retaining full control of the code: the overall flow, transitions, and individual actions.
  • Sketch the flow at a higher level on a napkin or diagram, and turn it into code: defining the big picture while letting AI handle the scaffolding the developer plugs in the business logic into each step.
  • Treat the workflow as an implementation detail and guide an agent through natural language prompts: goals and outcomes are set by the developer, but the steps are planned and executed dynamically at runtime.

Each approach offers a different balance of control versus autonomy. With code generation, autonomy is applied at implementation time; with agents, autonomy is delegated to AI at runtime. While agents bring flexibility and dynamic decision-making, they also introduce risks. Left on their own, they are nondeterministic, can hallucinate, and may lead to undesired outcomes. The best approach is to combine the strengths of both worlds: deterministic workflow steps that define the high-level flow, and agents embedded at individual steps to provide autonomy and adaptability. This is the sweet spot of Dapr Workflows combined with Dapr Agents: structure and oversight where it matters, flexibility where it is allowed.

The important point is that workflows are not going away. Quite the opposite, they are becoming more accessible and more ubiquitous than ever. What is changing is the way we build them, and AI is lowering the barrier for developers and teams to adopt them.

Find out more...

To dive deeper into Dapr workflows:

  1. Read about Dapr Workflows and join the Dapr Discord community.
  2. Try Durable Dapr Agents from the Quickstarts.
  3. Sign up for a Diagrid Catalyst trial and deploy your first workflow.
No items found.