github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/processors/process_dag.md (about) 1 --- 2 title: process_dag 3 type: processor 4 status: deprecated 5 --- 6 7 <!-- 8 THIS FILE IS AUTOGENERATED! 9 10 To make changes please edit the contents of: 11 lib/processor/process_dag.go 12 --> 13 14 import Tabs from '@theme/Tabs'; 15 import TabItem from '@theme/TabItem'; 16 17 :::warning DEPRECATED 18 This component is deprecated and will be removed in the next major version release. Please consider moving onto [alternative components](#alternatives). 19 ::: 20 21 A processor that manages a map of `process_map` processors and 22 calculates a Directed Acyclic Graph (DAG) of their dependencies by referring to 23 their postmap targets for provided fields and their premap targets for required 24 fields. 25 26 ```yaml 27 # Config fields, showing default values 28 label: "" 29 process_dag: {} 30 ``` 31 32 ## Alternatives 33 34 All functionality of this processor has been superseded by the 35 [workflow](/docs/components/processors/workflow) processor. 36 37 The names of workflow stages may only contain alphanumeric, underscore and dash 38 characters (they must match the regular expression `[a-zA-Z0-9_-]+`). 39 40 The DAG is then used to execute the children in the necessary order with the 41 maximum parallelism possible. You can read more about workflows in Benthos 42 [in this document](/docs/configuration/workflows). 43 44 The field `dependencies` is an optional array of fields that a child 45 depends on. This is useful for when fields are required but don't appear within 46 a premap such as those used in conditions. 47 48 This processor is extremely useful for performing a complex mesh of enrichments 49 where network requests mean we desire maximum parallelism across those 50 enrichments. 51 52 ## Examples 53 54 If we had three target HTTP services that we wished to enrich each 55 document with - foo, bar and baz - where baz relies on the result of both foo 56 and bar, we might express that relationship here like so: 57 58 ``` yaml 59 process_dag: 60 foo: 61 premap: 62 .: . 63 processors: 64 - http: 65 url: http://foo/enrich 66 postmap: 67 foo_result: . 68 69 bar: 70 premap: 71 .: msg.sub.path 72 processors: 73 - http: 74 url: http://bar/enrich 75 postmap: 76 bar_result: . 77 78 baz: 79 premap: 80 foo_obj: foo_result 81 bar_obj: bar_result 82 processors: 83 - http: 84 url: http://baz/enrich 85 postmap: 86 baz_obj: . 87 ``` 88 89 With this config the DAG would determine that the children foo and bar can be 90 executed in parallel, and once they are both finished we may proceed onto baz. 91