> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 工作流

> 調度並觸發多步驟自動化任務。

## 工作流

### 列出工作流

```typescript theme={null}
const workflows = await theo.workflows();
```

### 創建工作流

```typescript theme={null}
const workflow = await theo.createWorkflow({
  name: "Weekly Pipeline Report",
  triggerType: "schedule",
  triggerConfig: { cron: "0 9 * * 1" },  // Every Monday at 9am
  steps: [
    {
      type: "ai_transform",
      name: "Generate report",
      config: {
        prompt: "Analyze this week's pipeline changes",
        skills: ["data-extraction", "content-writer"],
      },
    },
    {
      type: "notification",
      name: "Send to team",
      config: { channel: "email", to: "team@acme.com" },
    },
  ],
});
```

### 觸發工作流

```typescript theme={null}
const run = await theo.triggerWorkflow(workflow.id, {
  overridePrompt: "Focus on enterprise deals this week",
});
```

## 渠道適配器

渠道適配器(Telegram、WhatsApp)部署在你自己的基礎設施中,並直接與 REST API 通信。請參閱 [Telegram](/guides/telegram-bot) 和 [WhatsApp](/guides/whatsapp-integration) 指南。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.