building-workflows
Ce qu’il fait
Cette compétence apprend à un agent à créer des automatisations dans PostHog, comme des séquences d'e-mails ou des messages envoyés après un événement. Elle s'adresse aux équipes qui veulent automatiser les messages envoyés à leurs utilisateurs ou clients.
Quand l’utiliser
- ✓Quand vous voulez configurer un workflow de messages par e-mail, SMS ou notification push dans PostHog.
- ✓Quand vous voulez une séquence d'e-mails envoyés après qu'un utilisateur a fait une action.
- ✓Quand vous voulez modifier ou réparer un workflow existant qui ne fonctionne pas correctement.
Lien du skill
https://github.com/PostHog/posthog/blob/master/products/workflows/skills/building-workflows/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Crée un workflow PostHog qui envoie un e-mail de bienvenue trois jours après l'inscription d'une personne.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent construit le workflow sous forme d'étapes reliées, avec un déclencheur qui démarre chaque exécution. Il vérifie d'abord l'état de la configuration, teste les étapes et garde le workflow en brouillon jusqu'à votre approbation.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
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.
- Compose the graph. Build
actions+edgesper references/graph-schema.md. For anyfunctionnode, don't guess the template: list the live catalog withcdp-function-templates-listand read its required inputs withcdp-function-templates-retrieve. - Create as a draft.
workflows-create. Every workflow is createddraft; it does not execute yet. - Test-run it.
workflows-test-runruns one step at a time. Start at the first step (omitcurrent_action_id, or point it at the trigger) with sampleglobals({event, person, groups}), shaped like the trigger's real payload: aneventtrigger needs an event matching its filters, and aninternal-eventtrigger needs an event named in itsfilters.events(for the Slack trigger, a$slack_message_receivedevent with the Slack property bag) and no person (see references/graph-schema.md). Astatus=skippedresult 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 ascurrent_action_idand run again, walking step by step to the end. Skipdelaynodes by jumping to the action after them (delays aren't simulated). Async side effects (HTTP/email/SMS/push) are mocked unless you setmock_async_functions=false. Read each step's trace to confirm the path taken. - Read logs while iterating.
workflows-logsshows the per-step execution trace (levels DEBUG to ERROR). This is how you see why a step skipped, branched, or errored. - 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). - Enable (needs the user's explicit sign-off).
workflows-enableflips it toactiveand 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. - Dispatch (batch/schedule only). A
batchorscheduleworkflow does not fire on enable alone. Send a one-off broadcast withworkflows-run-batch, or attach a recurring schedule withworkflows-schedule-create. Abatchtrig
Questions fréquentes
Un workflow envoie-t-il des messages tout de suite ?
Pas tant qu'il est en brouillon. L'agent le garde en brouillon jusqu'à votre approbation.
Un e-mail de réinitialisation de mot de passe est-il un workflow ?
Non. Un message unique envoyé par votre code est un e-mail transactionnel, couvert par une autre compétence.
L'agent doit-il vérifier d'abord ma configuration d'envoi ?
Oui. Pour les workflows de messagerie, il vérifie d'abord les étapes de configuration encore ouvertes.
Détails
Description originale de l’auteur
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
Popularité
- Étoiles GitHub
- 41k
- Position au classement
- #6980
- Licence
- —
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
depot-ci
41kAide votre agent à configurer et exécuter des workflows Depot CI, alternative à GitHub Actions, en migrant les workflows existants et en lisant les journaux.
depot-container-builds
41kAide votre agent à construire des images Docker sur les constructeurs distants de Depot, y compris les images multiplateformes et la correction des échecs.
depot-github-runners
41kAide votre agent à faire tourner les jobs GitHub Actions sur les machines gérées par Depot, à choisir la taille des runners et leurs labels, et à résoudre les problèmes de configuration.
editing-agents-md
41kAide votre agent à décider si une règle doit figurer dans un fichier AGENTS.md ou CLAUDE.md, et à la rédiger pour qu'elle soit suivie sans alourdir le fichier.
Skills similaires
knowledge-automation
394kAide votre agent à configurer une tâche récurrente qui ajoute du nouveau contenu à votre coffre Knowledge selon un calendrier, puis vérifie qu'elle fonctionne.
knowledge-source-ingest
394kAide votre agent à tenir un coffre Knowledge à jour avec les nouveaux éléments de canaux de discussion, de flux ou de boîtes mail, sans rajouter ce qui existe déjà.
benchmark
280kAide votre agent à mesurer la vitesse et les performances du code. Utile pour s'assurer que tout est rapide et repérer les lenteurs.