SubFlow
View as MarkdownThis page lists the Go SDK names for SubFlows. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Go SDK API reference.
API names
| Task | Go API | Dex behavior |
|---|---|---|
| Start a child Flow and wait for it | SubFlow in WaitFor | SubFlows |
| Set the child timeout, Attributes, and configuration | SubFlowOptions | SubFlowOptions |
| Choose what happens to an existing child | ReusePolicy of SubFlowOptions, with SubFlowReusePolicy | SubFlowReusePolicy |
| Read the child result | SubFlowResult in Execute. It returns a FlowResult. | SubFlow results |
| Read the generated child Flow ID | SubFlowID | SubFlowReusePolicy |
| Stop a child that lost an AnyOf | Client.StopFlow with the child Flow ID | Stop a Flow |
Step types that start SubFlows
Changed in 1.45: a Step whose Step type contains "-" cannot start SubFlows.
The child Flow ID is "SubFlow:" followed by the parent Flow ID, the Step execution ID, and the SubFlow index, joined with "-". The Step execution ID is the Step type and a counter, also joined with "-". A dash in the Step type makes the child Flow ID ambiguous, so two parents could share one child.
Default Step types are Go type names and never contain "-". Only a GetStepType override can return one. When such a Step returns a Wait with a SubFlow Condition, the Worker logs a warning and sends the WaitFor result unchanged. Dex Server rejects it as an invalid Worker response and fails the attempt without retry. Under the default policy, the Flow fails. Steps with a dash that never start SubFlows are not affected.
To migrate, rename the Step type to a name without "-".