# Building Workflows in Coze: A Step-by-Step Guide
In the previous video, we introduced how to build a bot from scratch in Coze and explained the usage of each skill. With your overwhelming support to reach 50 likes, we are now diving into the intricate world of workflows. This guide will clarify the distinction between workflows and multi-agent modes in Coze, as well as provide a comprehensive step-by-step tutorial on creating a workflow effectively.
## Understanding Workflows vs. Multi-Agent Modes
It's easy to confuse workflows with multi-agent modes when you're just starting out with Coze. Though both are constructed using nodes, they serve diverse functions:
- **Workflows**: These are structured modules within a bot that perform standardized tasks. Think of a workflow as an independent technician who can analyze information to draft content.
- **Multi-Agent Modes**: This functions like a team composed of various specialists, where tasks can range from writing to graphic design and editing.
Fine-tuning your tasks makes them more manageable, allowing easier troubleshooting and optimization without needing a complete system overhaul.
## Creating a Workflow in Coze
Let's get started by creating a workflow. First, log into Coze and navigate to the "Personal" section, followed by selecting "Workflows" and hitting the "Create" button.
Upon successful creation, you will arrive at the workflow operation page where you can freely add nodes. Here's how to structure this interface:
- The left column displays node types you can add: plugins, language models, code, knowledge bases, workflows, conditional checks, variables, databases, and information. Notably, this overlaps with skills from the single-agent mode.
- The central workspace is where you connect the nodes, starting with "Start" and "End" nodes.
- Use the hand icon to drag the workspace and manage the node arrangement. Zoom options are also available for better visibility.
### Basic Node Configuration
To illustrate, let’s connect the "Start" and "End" nodes for a simple parameter transfer. Click on the "Start" node to reveal the input section and define your variable as "test" with the type set to "string." In the "End" node, connect it to the output, preparing the stage for our workflow tests.
Click "Test Run" to observe how your nodes interact and confirm that the variable transfers correctly.
## Enhancing Functionality: News Retrieval Workflow
Now, let’s increase the complexity by creating a workflow that retrieves news based on given keywords. Here’s how to incorporate a news plugin:
1. **Add a Plugin Node** - Click to include the "Get News" node.
2. **Connect the Nodes** - Link the "Start" node output to the "Get News" input, then connect "Get News" output to the "End" node.
Next, configure the language for news retrieval and set relevant parameters to define how the data flows, allowing the system to retrieve and output the titles of the news articles successfully.
### Summarizing with a Language Model
Following the news retrieval, introduce a language model node to summarize retrieved articles. Define the connection from "Get News" to the language model node, and then to the "End" node. Here, establish the model type as GPT-4 and specify instructions on how content should be summarized.
This method ensures you have both the original description and the rephrased content available for outputs.
## Implementing Conditional Logic
Let's add a layer of decision-making with a condition node. We can scan the news description for specified keywords and decide if rewriting is necessary.
1. **Insert a Conditional Node** - Place this after the "Get News" node, ensuring proper connections based on keyword presence.
2. **Define Keyword Checking Logic** - Input parameters define how this node will operate based on what it finds in descriptions.
### Final Touches: Publishing the Workflow
Before using the workflow in a bot, it needs to be published. Click the publish button to finalize your setup. Afterward, create a bot that integrates this workflow, enabling it to function as a news search and rewriting agent for user queries.
## Conclusion and Next Steps
In this video, we guided you through the process of crafting a complete workflow that retrieves articles based on keywords and intelligently summarizes them. The visual nature of this node system mirrors programming but provides a more intuitive experience for users.
As you embark on your journey to develop workflows, remember that Coze offers extensive nodes to explore. We're excited to see what you create! Don’t forget to like and subscribe for more Coze-related content.
See you in the next video!