Accessing values from Branch blocks in Workflows
Overview
When building workflows with conditional branches, you may need to access values collected within branch blocks in subsequent steps. This article explains how to properly reference these values using dot notation, ensuring your workflow remains efficient without duplicating steps.
Using dot notation to access Branch values
You can access values from within a branch block using dot notation without needing to reference the specific branch or path. This approach allows you to reference information across different parts of your workflow seamlessly.
Example:
To access a value from a user input step within a branch, use:
actions['user-input-slug'].outputs['org']['name']Troubleshooting value accessibility
If you find that values collected inside a branch block are not accessible outside the branch, follow these steps:
- Use direct dot notation that references the specific action and its outputs
- Add an empty path for reverse conditions if the expected information is not initially set in the step above the conditional block
Benefits of this approach
Using dot notation to reference values from branch blocks allows you to:
- Maintain cleaner workflow configurations
- Avoid duplicating subsequent steps under each branch path
- Access information consistently regardless of which branch path was executed