Transitions
Learn about transitions and how nodes connect in workflows
Transitions define how nodes connect and flow within your workflows. They determine the path your workflow takes based on different conditions and outcomes. There are three main types of transitions in Asteroid:
Types of transitions
AI Transitions
AI Transitions
AI transitions are the most flexible type of transition, allowing AI nodes to intelligently decide which path to take based on the current context and conditions.
AI Transition
A transition that can be picked by AI nodes based on intelligent decision-making
When to use:
- When you need dynamic routing based on content or context
- For workflows that require intelligent decision-making
- When the next step depends on AI analysis of the current state
Example:
Selector Transitions
Selector Transitions
Selector transitions are deterministic, allowing for a immediate transition if an event happens.
Selector Transition
A transition that occurs when the selector is found on the page
When to use:
- When you need to wait for specific elements to appear
- For conditional navigation based on page content
Example:
Outcome Success Transitions
Outcome Success Transitions
Outcome Success transitions are used by deterministic nodes like Playwright or API nodes that have clear success states.
Outcome Success
Used by nodes like Playwright or API which are deterministic and have clear success outcomes
When to use:
- With API nodes to handle successful responses
- With Playwright nodes for successful web interactions
- For any deterministic node with clear success criteria
Best Practices
Choosing the Right Transition
Choosing the Right Transition
- Use AI transitions for dynamic, content-based routing
- Use Selector transitions for immediate, deterministic, reactions
- Use Outcome Success for deterministic operations with clear results
Failure Transitions
Failure Transitions
- Make sure to connect your AI nodes to the
End with Failure
node to ensure that your program detects failure conditions.