General concepts
Last updated
Last updated
To get started with workflows, it's good to understand some of it core constructs.
Every Leverage workflow turns into an API once published. Workflows always start with a Trigger node and end with a Return node. The arguments provided in the Trigger node form the contract of how the API interface is defined. Workflows will throw validation errors when incorrect data is submitted to the workflow.
So, you can think of a workflow as calling an API, but with a lot of AI capabilities integrated into the process.
While workflows always start with a Trigger node and end with a Return node, the real power lies in what happens between these points. You can create complex chains of functionality by adding new nodes to your workflow:
Adding Nodes:
Drag the purple-coloured circle of an existing node to a new spot on the canvas.
This action opens a menu where you can select the next node to add.
Once selected, the new node is placed on the canvas, ready for configuration.
Flexible Connections:
Nodes support many-to-many connections, allowing for versatile workflow designs.
This flexibility enables both parallel processing and the convergence of multiple paths.
Parallelism in Workflows:
You can create parallel branches to perform multiple operations simultaneously.
For example, run several AI prompts based on a single input concurrently.
Converging Paths:
After exploring various parallel paths, you can bring your workflow back to a common point.
This allows you to consolidate results from different branches for further processing.
Practical Application:
One effective use is to generate multiple AI responses to a given input in parallel.
Then, funnel all these outputs into a single node for comprehensive analysis or aggregation.
By mastering these concepts, you can create sophisticated workflows that efficiently process data, leverage AI capabilities, and produce powerful results.
In workflows, the input of one node is typically derived from the output of a previous node. Nodes can access variables from any preceding nodes that are connected to them through defined links.
To inspect a node’s input and output, use the designated buttons at the bottom of each node. This allows you to preview both the input and output, providing valuable insights into what each node is generating. This makes it easier to determine which data can be referenced in subsequent nodes.
You can reference outputs from previous nodes by typing double curly brackets {{ }} in the input fields. This triggers an autocompletion feature, allowing you to explore available data and data types that can be referenced. Read more about Variables in workflows.