{
  "id": 17088835,
  "title": "How Fan-Out/Fan-In Works in Dapr Workflow",
  "url": "https://urgent.news/2026/10/29/how-fan-out-fan-in-works-in-dapr-workflow",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-29T16:38:36.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/diagrid/how-fan-outfan-in-works-in-dapr-workflow-4co6"
  },
  "original_language": "en",
  "account": "Fan-out/fan-in is a workflow pattern in Dapr that allows processing of a large list of items in parallel, while ensuring that all results are recorded in the workflow's history for recovery after crashes. By scheduling a batch of activities at once, waiting for their completion with when_all, and combining the results, fan-out/fan-in optimizes time consumption and handles process failures efficiently. The Python SDK 1.19 of the Dapr package provides built-in support for this pattern. Install it using pip install dapr[workflow]. The pattern's key steps involve getting a list of items, starting a process_item activity for each item, waiting for all tasks to complete with when_all, and finally aggregating the results using a save_total activity. In case of a crash during the process, the workflow resumes from the point where it left off, skipping the completed activities and rescheduling only the unfinished ones. However, when implementing fan-out/fan-in, it is essential to consider certain limitations, such as the dispatch size cap of 4 MiB by default, which may lead to workflow stalls if exceeded. To avoid this, ensure that returned results are small and consider splitting large fan-outs into child workflows or scheduling items in chunks. Additionally, plan for failures by setting appropriate retry policies or handling errors within activities. Fan-out/fan-in is just one of the six workflow patterns provided by Dapr, alongside task chaining, async HTTP APIs, monitor, external system interaction, and compensation.",
  "summary": "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…",
  "key_points": [
    "Fan-out/fan-in pattern processes large lists in parallel with Dapr",
    "Python SDK 1.19 provides built-in support for the pattern",
    "Workflow resumes from last point after crashes, skipping completed tasks"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}