Menu

How Fan-Out/Fan-In Works in Dapr Workflow
📰

How Fan-Out/Fan-In Works in Dapr Workflow

DEV Community: microservices·Marc Duiker·18 days ago
#lCac77lZ
#devtomicroservices#devto#dev#workflow#dapr
Reading 0:00
15s threshold

Introduction

You have a list of items to process, and each item takes a while. Running them one after another wastes time, and running them in parallel on threads loses everything when the process dies halfway. Fan-out/fan-in in Dapr Workflow solves both. You schedule a batch of activities at once, wait for all of them with when_all , and combine the results. Each finished activity is recorded in the workflow's history, so after a crash the workflow only schedules the activities that hadn't finished. This post walks through the Python version and what a crash does to a half-finished batch. If the idea of a workflow history is new to you, read the durable execution concepts first. The code is tested with Dapr 1.19.

One of six workflow patterns

The Dapr docs describe six workflow patterns : task chaining, fan-out/fan-in, async HTTP APIs, monitor, external system interaction, and compensation.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.