360 Secure SkillHub
360 安全技能中心

Automation Workflow

该 Skill 提供一份 YAML 工作流格式说明和一个 Python 脚本:可以用定时、Webhook、文件变更、队列等触发方式启动;可以依次执行 HTTP 请求、Telegram 通知、邮件、数据转换、存储等动作。脚本支持单次运行、后台守护以及加载环境变量文件,依赖 schedule 与 requests。

dinghaibin
dinghaibin
热度 34.90
最近更新 2026-05-18 11:49:21
分类:自动化依赖:代码执行 / 第三方 API / 读写文件应用场景:自动化脚本 / 工作流 / API 集成 / 日程安排 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add flow-automation
Metadata
name
automation-workflow
description
Create and manage automation workflows for repetitive tasks. Use when user needs to schedule periodic data sync, chain API calls, set up triggered actions, build if-this-then-that style automation, or create multi-step business workflows.

Automation Workflow

Create and manage automation workflows for repetitive tasks.

Quick Start

# Install dependencies
pip install schedule requests

# Run a simple workflow
python scripts/workflow.py examples/simple.yaml

Core Concepts

  • Trigger: What starts the workflow (time, webhook, file change)
  • Actions: What gets executed (API calls, notifications, data transformations)
  • Flow Control: Conditions, loops, error handling

Workflow Format (YAML)

name: daily-report
trigger:
  type: schedule
  cron: "0 9 * * *"  # Daily at 9am

actions:
  - name: fetch-data
    type: http
    config:
      url: https://api.example.com/data
      method: GET
      
  - name: process
    type: transform
    config:
      template: "Report: {{results.count}} items"
      
  - name: notify
    type: telegram
    config:
      chat_id: "{{env.CHAT_ID}}"
      message: "{{processed}}"

Supported Triggers

  • schedule: Cron-based scheduling
  • webhook: HTTP POST/GET triggers
  • file: Watch for file changes
  • queue: Message queue triggers

Supported Actions

  • http: Make HTTP requests
  • telegram: Send Telegram messages
  • email: Send emails
  • transform: Data transformation
  • storage: Save/load data

Usage Examples

See references/examples.md for more.

Daily Report Workflow

name: daily-sales
trigger:
  type: schedule
  cron: "0 8 * * *"
actions:
  - type: http
    name: get-sales
    config:
      url: https://api.shop.com/sales
  - type: transform
    name: format
    config:
      template: "Sales: ${{results.total}}"
  - type: telegram
    name: send
    config:
      message: "{{formatted}}"

Webhook Trigger

name: github-webhook
trigger:
  type: webhook
  path: /webhook/github
actions:
  - type: transform
    name: parse
    config:
      template: "New {{payload.action}} on {{payload.repository}}"

Script Usage

python scripts/workflow.py [OPTIONS]

Options:
  --file PATH      Workflow YAML file (required)
  --run-once       Run workflow once and exit
  --daemon         Run as background daemon
  --env FILE       Load environment variables

Best Practices

  1. Use environment variables for secrets
  2. Add error handling for each action
  3. Log actions for debugging
  4. Test workflows with --run-once first