Code
Key points
- Isolation: Private flows create an isolated execution environment. Tasks within a private flow cannot access or modify the context of the parent flow directly.
-
Data encapsulation: Sensitive information (
sensitive_info
) is only available within the private flow, protecting it from accidental exposure in the main workflow. -
Context control: By setting
args_as_context=False
, we can pass the sensitive information to the flow function without adding it to context automatically. -
Result passing: Results from the private flow (like
masked_info
) can be explicitly passed back to the main flow for further processing. - Nested structure: Private flows can be nested within larger workflows, allowing for modular and secure task organization.
Further reading
- To learn more about flows in ControlFlow, see the flows documentation.