Controls
Control nodes manage the flow of your workflows in Lleverage. They are responsible for starting, ending, or directing the workflow execution based on conditions or triggers.
Triggers
Triggers initiate the execution of a workflow. Lleverage offers several types of triggers:
API Trigger: Creates a Lleverage API endpoint by specifying a path and HTTP method. Once configured, you can start a workflow by making an API call from your application.
Form Trigger: Similar to the API Trigger, this creates an API endpoint that accepts a form body as the trigger to start workflow execution.
Branch
A Branch node enables conditional branching in your workflow. Based on logical conditions, the workflow can follow different paths:
Cases: Define multiple conditions (cases) that evaluate incoming data. Each case can have its own set of nodes to execute. For example, a case called "Sci-fi" might have the condition
state.movie.genre === 'scifi'
.Default Case: Always available as a fallback if none of the defined cases match.
You can add an unlimited number of cases, and each case can end the workflow with a Response Node if needed.
Loops
The Loop node allows you to process multiple items in a list by repeating a set of actions for each item. The loop iterates through an array of inputs and runs the enclosed nodes for each one. Once all items are processed, the workflow continues to the next node. This is a great way to call prompts in parallel for a large number of items.
Use {{loop.item}}
(or whatever you called your loop) to reference the contents of the current item.
Repeat
The Repeat node allows you to execute a set of actions multiple times based on a specified count or condition. This is useful for scenarios where you need to perform repetitive tasks until a certain criteria is met. After completing the specified repetitions, the workflow continues to the next node.
Returns
Return Nodes are placed at the end of a workflow to send the result back to your application. Return types align with the data types supported by Links:
Structured Data: Returns data as a JSON object or table.
Text Data: Returns data as a string.
Files: Returns files such as images or audio, with the appropriate headers like
Content-Type
andContent-Length
.Streams: Returns text or audio streams via an HTTP stream. You can use the Lleverage SDK to handle stream output more easily.
Last updated