創建工作流
const workflow = await theo.createWorkflow({
name: "Weekly Newsletter Draft",
triggerType: "schedule",
triggerConfig: { cron: "0 9 * * 1" },
steps: [
{
type: "ai_transform",
name: "Research trends",
config: { prompt: "Research top AI trends this week", skills: ["deep-research"] },
},
{
type: "ai_transform",
name: "Draft newsletter",
config: { prompt: "Draft a newsletter from the research above", skills: ["content-writer"] },
},
{
type: "notification",
name: "Send draft",
config: { channel: "email", to: "editor@acme.com" },
},
],
});
觸發器類型
| 類型 | 說明 |
|---|---|
schedule | 基於 Cron 表達式的調度 |
event | 由系統事件觸發 |
manual | 通過 API 調用觸發 |
