Hands-On: Build a Daily Summary Workflow from Scratch
Follow a specific business scenario to string together the core concepts: read RSS → classify → generate summary → manual confirmation.
This tutorial uses a saveable and verifiable workflow to connect Agent, code, classifier, variables, manual approval and scheduling. Run through the core process first, and then add notifications, file release and other subsequent steps according to actual needs.
- Already logged into Braidrun.
- There is an available credential in the credential center whose provider is openrouter, or change the model and provider in the example to the combination configured for the current account.
- The deployment environment allows the code step to access the sample RSS address; if the network is restricted, you can change it to a data source you can access.
Goal: Generate a summary of technology news pending approval
The process is divided into four steps:
fetch_news— Use Python standard library to read RSS and extract news titles.classify_topic— Determine whether this batch of content is mainly about AI themes.write_digest— Generate Chinese summary only when classified as ai.review_digest— Suspend execution and wait for approval from someone with authority.
Step 1: Create a new workflow
- Enter "Workflow" and select New Workflow.
- Fill in the name daily-tech-digest and enter the editor after creation.
- Switch to the YAML tab and replace the draft content with the complete example below.
Step 2: Understand the top configuration
name: daily-tech-digest
version: 1.0.0
description: 读取科技 RSS,生成待审批摘要
variables:
rss_url: "https://hnrss.org/frontpage"
max_items: "8"
variable_types:
rss_url: string
max_items: number
agents:
writer:
preset: writer
overrides:
llm_config:
models:
- model: openai/gpt-5.4
provider: openroutervariablesSave a default input that can be overridden at runtime.variable_typesDeclare the type in parallel with variables.agentsDeclare the Agent used by the workflow; provider is a service identifier, not a credential label.
Step 3: read and extract RSS content
workflow:
- step: fetch_news
code:
language: python
timeout: 60
script: |
import json
import os
import urllib.request
import xml.etree.ElementTree as ET
url = os.environ["WF_VAR_RSS_URL"]
limit = int(os.environ.get("WF_VAR_MAX_ITEMS", "8"))
with urllib.request.urlopen(url, timeout=20) as response:
root = ET.fromstring(response.read())
titles = [
(item.findtext("title") or "").strip()
for item in root.findall(".//item")
][:limit]
print(json.dumps({"articles": titles}, ensure_ascii=False))
extract:
- json_path: $.articles
variable: articles
idempotent: trueThe code step writes JSON to standard output, and extract uses JSON Path to store articles in a runtime variable. idempotent: true means the step can be safely rerun during recovery; it does not mean the remote content will always be identical.
Step 4: Classify and generate summaries
- step: classify_topic
classifier:
agent: writer
input: |
判断以下新闻是否以 AI 为主要主题:
{{articles}}
categories:
- name: ai
description: "多数内容与 AI、机器学习或大模型有关"
- name: other
description: "主要是其它科技主题"
output_variable: digest_topic
default_category: other
depends_on:
- fetch_news
- step: write_digest
agent: writer
depends_on:
- classify_topic
condition: "digest_topic == 'ai'"
input: |
将以下标题整理成简洁的中文 Markdown 摘要。
不要补充标题中没有的事实:
{{articles}}
idempotent: true- classifier writes the results to digest_topic.
- write_digest uses depends_on to establish the sequence, and uses condition to control whether to execute.
- The upstream step output uses steps.<step name>.output; the variables generated by extract and classifier are directly referenced by variable names.
Step 5: Add manual approval
- step: review_digest
depends_on:
- write_digest
manual_approval:
enabled: true
approvers: []
timeout: 3600
approval_message: |
请确认这份摘要是否可以继续使用:
{{steps.write_digest.output}}When executed here, it will enter the pending approval state. When approvers is empty, the execution initiator or collaborators with execution permissions can process it; after specifying approvers, only users in the list and platform administrators can make decisions.
Complete YAML
name: daily-tech-digest
version: 1.0.0
description: 读取科技 RSS,生成待审批摘要
variables:
rss_url: "https://hnrss.org/frontpage"
max_items: "8"
variable_types:
rss_url: string
max_items: number
agents:
writer:
preset: writer
overrides:
llm_config:
models:
- model: openai/gpt-5.4
provider: openrouter
workflow:
- step: fetch_news
code:
language: python
timeout: 60
script: |
import json
import os
import urllib.request
import xml.etree.ElementTree as ET
url = os.environ["WF_VAR_RSS_URL"]
limit = int(os.environ.get("WF_VAR_MAX_ITEMS", "8"))
with urllib.request.urlopen(url, timeout=20) as response:
root = ET.fromstring(response.read())
titles = [
(item.findtext("title") or "").strip()
for item in root.findall(".//item")
][:limit]
print(json.dumps({"articles": titles}, ensure_ascii=False))
extract:
- json_path: $.articles
variable: articles
idempotent: true
- step: classify_topic
classifier:
agent: writer
input: |
判断以下新闻是否以 AI 为主要主题:
{{articles}}
categories:
- name: ai
description: "多数内容与 AI、机器学习或大模型有关"
- name: other
description: "主要是其它科技主题"
output_variable: digest_topic
default_category: other
depends_on:
- fetch_news
- step: write_digest
agent: writer
depends_on:
- classify_topic
condition: "digest_topic == 'ai'"
input: |
将以下标题整理成简洁的中文 Markdown 摘要。
不要补充标题中没有的事实:
{{articles}}
idempotent: true
- step: review_digest
depends_on:
- write_digest
manual_approval:
enabled: true
approvers: []
timeout: 3600
approval_message: |
请确认这份摘要是否可以继续使用:
{{steps.write_digest.output}}Step 6: validation, preview, and real execution
- Click "Verify" to fix structure, variable and dependency errors first.
- Open the execution dialog and click "Preview" to check the steps, dependencies, conditions and missing variables. The staging does not request RSS, call models, or validate credentials.
- Click "Start Execute" with test input. Check the output, classification results, and summary of fetch_news in the execution details.
- Go to "Approval Management" to open the record to be approved, confirm the summary and then approve or reject.
- fetch_news failed: First confirm that the deployment network can access rss_url.
- Model step prompts for missing credentials: Confirm that the provider is consistent with the provider in Credential Center and check the personal or team scope.
- write_digest is skipped: This is the normal SKIPPED branch when the classification result is not ai.
Step 7: Run as scheduled
- Enter "Scheduling Management" and select New Schedule. The Free plan does not provide scheduling quota.
- Select daily-tech-digest, select cron as the type, and fill in the expression
0 8 * * *, select Asia/Shanghai as the time zone. - After saving, check the expressions and time zone in the list, and first use "Run Now" to verify it.
What can be added next?
- Manual Approval — Specify the approver, timeout and editable approval content.
- Credentials — Configure the key required by the model or code step.
- Third-Party Authorizations — Integrate external business systems into the workflow, and the official modules can be used out of the box.
- Modularization and Reuse — Place stable logic such as notifications and file publishing in a sub-workflow after approval.