Chuyển đến nội dung
Skillpedia
Tự động hóa41k · #6980

building-workflows

Skill này làm gì

Skill này dạy agent xây các workflow tự động trong PostHog, chẳng hạn chuỗi email hoặc tin nhắn gửi sau một sự kiện. Skill dành cho các nhóm muốn tự động hóa tin nhắn gửi đến người dùng hoặc khách hàng.

Khi nào nên dùng

  • ✓Khi bạn muốn thiết lập workflow gửi email, SMS hoặc thông báo đẩy trong PostHog.
  • ✓Khi bạn muốn một chuỗi nhỏ giọt gửi tin nhắn sau khi người dùng thực hiện một hành động.
  • ✓Khi bạn muốn thay đổi hoặc sửa một workflow hiện có đang không chạy đúng.

Liên kết skill

https://github.com/PostHog/posthog/blob/master/products/workflows/skills/building-workflows/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/PostHog/posthog/blob/master/products/workflows/skills/building-workflows/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy xây một workflow PostHog gửi email chào mừng ba ngày sau khi ai đó đăng ký.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent xây workflow như một tập hợp các bước được kết nối, với một trigger khởi động mỗi lần chạy. Nó kiểm tra trạng thái thiết lập trước, kiểm thử các bước và giữ workflow ở dạng nháp cho đến khi bạn phê duyệt.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Building workflows

A PostHog workflow is a directed graph: a list of action nodes (actions) wired by edges (edges), with exactly one trigger node that starts every run. You author that graph as JSON and ship it over MCP. Always call it a "workflow" to the user. "Hog flow" is the internal code name (HogFlow), not a user-facing term.

The single biggest failure mode is getting the graph JSON structurally wrong. The backend stores actions/config as loose JSON, but the visual editor parses every node against a strict schema, so a malformed node saves but then breaks the editor view for the whole workflow. Before composing or editing any graph, read references/graph-schema.md. It is the contract; do not improvise node shapes from these examples alone.

A one-off email that the user's code sends to one person, such as a password reset, a sign-in code or a receipt, is a transactional email, not a workflow. Use the sending-transactional-emails skill for it.

Before the first messaging workflow

When the user asks to set up workflows or messaging, or asks for an email, SMS or push workflow in a project that may not send yet, call workflows-setup-status before composing anything. It says which setup steps are open and links each one in the app. Walk the user through the open steps, set the sending rules, then offer suggested workflows. Read references/onboarding.md for the flow and the defaults to recommend.

Skip this for automations that only post to Slack or call webhooks: they need no email setup. If workflows-setup-status is not available, go straight to the lifecycle below.

The lifecycle

Work the workflow through these stages. Don't jump straight to enabling it.

  1. Compose the graph. Build actions + edges per references/graph-schema.md. For any function node, don't guess the template: list the live catalog with cdp-function-templates-list and read its required inputs with cdp-function-templates-retrieve.
  2. Create as a draft. workflows-create. Every workflow is created draft; it does not execute yet.
  3. Test-run it. workflows-test-run runs one step at a time. Start at the first step (omit current_action_id, or point it at the trigger) with sample globals ({event, person, groups}), shaped like the trigger's real payload: an event trigger needs an event matching its filters, and an internal-event trigger needs an event named in its filters.events (for the Slack trigger, a $slack_message_received event with the Slack property bag) and no person (see references/graph-schema.md). A status=skipped result means this payload would not fire the trigger: if you fabricated the payload, fix it to match the trigger; if it came from a real past run (workflows-get-invocation), the trigger's filter is wrong, not the payload. The result includes the next step's id (nextActionId). Feed that back as current_action_id and run again, walking step by step to the end. Skip delay nodes by jumping to the action after them (delays aren't simulated). Async side effects (HTTP/email/SMS/push) are mocked unless you set mock_async_functions=false. Read each step's trace to confirm the path taken.
  4. Read logs while iterating. workflows-logs shows the per-step execution trace (levels DEBUG to ERROR). This is how you see why a step skipped, branched, or errored.
  5. Edit, then re-test. Patch the graph with workflows-patch-graph (see Editing a draft). Every edit invalidates your earlier test — re-run the affected path before moving on. On a draft workflow, edits apply directly; on an active one they stage a draft (see Changing a live workflow).
  6. Enable (needs the user's explicit sign-off). workflows-enable flips it to active and an event/webhook/manual trigger starts firing on matching activity. From then on it runs on real people, and every change goes through the draft → test → publish cycle before taking effect — so finish testing, then get the user's explicit go before enabling. Don't enable on your own initiative.
  7. Dispatch (batch/schedule only). A batch or schedule workflow does not fire on enable alone. Send a one-off broadcast with workflows-run-batch, or attach a recurring schedule with workflows-schedule-create. A batch trig
Câu hỏi thường gặp

Workflow có gửi tin nhắn ngay không?

Không khi nó còn là nháp. Agent giữ nó ở dạng nháp cho đến khi bạn phê duyệt.

Email đặt lại mật khẩu có phải là workflow không?

Không. Một email một lần do mã của bạn gửi là email giao dịch, và một skill khác bao quát việc đó.

Agent có nên kiểm tra thiết lập gửi email của tôi trước không?

Có. Với workflow nhắn tin, nó kiểm tra trước những bước thiết lập nào còn đang mở.

Chi tiết

Mô tả gốc của tác giả

Build, edit, test, enable, and monitor PostHog workflows over MCP. Author the action/edge graph so it runs and opens cleanly in the visual editor, then change drafts surgically with patch operations. Use when asked to build, set up, automate, change, fix, or debug a workflow, campaign, broadcast, drip sequence, or event-triggered automation in the workflows product, including first-time messaging setup (email channel, sending domain, frequency cap) before the first workflow.

repo: PostHog/posthog

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6980
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự