Create Workflow

Last updated on Oct 22, 2024

Workflows significantly simplify complex tasks by breaking intricate tasks into smaller, manageable steps, known as nodes. This approach reduces dependence on prompt engineering and model inference, while boosting LLM applications' efficiency for complex processes. Additionally, workflows enhance system interpretability, stability, and fault tolerance by supporting visual drag-and-drop node orchestration using serial and parallel design patterns.

Serial Node Design Pattern

Nodes in a serial pattern execute sequentially, each starting its operation only after its predecessor completes and delivers output. This ensures logical task execution in a defined order.

Example Workflow: In a "Content Creation" agent, users input their requirements such as tone, format, and target audience. The system then sequentially assists with research, drafting, and editing, with each node relying on the preceding one to maintain content quality and coherence.

Steps for Designing a Serial Structure

  1. Insert a new serial node by clicking the + icon between existing nodes.

  2. Link the nodes in sequence.

  3. Funnel all paths to an "End" node to complete the workflow.

Parallel Structure Design Pattern

This design allows multiple nodes to operate concurrently, enabling previous nodes to trigger numerous subsequent nodes simultaneously. Parallel nodes run independently, enhancing workflow efficiency by executing tasks in parallel.

Example Workflow: In a "Survey Analysis" application, once users input survey data, nodes within the parallel structure analyze various segments of the survey responses simultaneously, such as statistical analysis, sentiment analysis, and trend identification, thus expediting the overall evaluation process.

Steps for Designing Parallel Structures

  1. Add Nodes with Hover Action: Hover over an existing node and click the + button to automatically create multiple nodes, establishing a parallel framework.

  2. Drag Connections: Use the drag feature from the + button on a node to develop parallel branches.

  3. Next Step Additions: In a node's right panel, use the "Next Step" section to add parallel nodes, setting up a parallel architecture.

Common Parallel Structure Patterns

  1. Normal Parallel: A straightforward Start | Parallel Nodes | End is intuitive for simultaneously running multiple tasks after user input, supporting up to 10 branches.

  2. Nested Parallel: Involves complex multi-layer operations, such as external API requests with results feeding into downstream nodes, with support for up to 3 nesting layers.

  3. Conditional Branch + Parallel: Utilizes parallel nodes alongside IF/ELSE branches.

  4. Iteration Branch + Parallel: Integrates parallel processing within iterative loops for efficiency in repeating tasks.

Previewing the Workflow

Click "Run" to enter debugging mode and use the right-side interface for testing the workflow's configuration.

Publishing the Workflow

After completing debugging, click "Publish" to save your workflow and release it as a reusable tool. By publishing the workflow, all workspace members gain the capability to apply it within agent settings.

If needed, click "Restore" to preview and revert to the last published version, overwriting the current one if confirmed.