adding-a-trigger
БесплатноБез исполняемых скриптовНе проверенChecklist for adding a new TriggerCrud-based trigger type to Windmill (Azure, GCP, Kafka, etc.). Use when wiring a new trigger kind across backend, frontend…
от windmill-labs★ 18 798 звёзд на GitHubОб этом скилле
Skill: Adding a New Trigger Type
Use this skill when adding a trigger kind that implements TriggerCrud (Kafka, GCP, Azure, MQTT, SQS, NATS, Postgres, Email…). For native triggers (Nextcloud, Google Drive — things wired through windmill-native-triggers), use the native-trigger skill instead.
The goal of this doc is to enumerate every file that needs to change. Missing any one of them leads to silent regressions: sync drops the trigger, capture button does nothing, workspace forks lose it, sidebar counters undercount. Follow the checklist top-to-bottom — each section is independent enough to be validated on its own.
Throughout this doc, substitute {kind} for the new trigger kind (azure, kafka, …), {Kind} for PascalCase (Azure, Kafka), {KIND} for SCREAMING (AZURE, KAFKA).
Reference implementations
- GCP — closest analogue to Azure. Has push + pull, OIDC auth, ARM-like resource paths, capture handler. Grep for
gcp_trigger/GcpTrigger. - Kafka — simpler (pull-only, streaming). Good for trivial integrations.
- Azure — most recently added (2026). Shared-secret push auth, Event Grid namespaces + basic topics, ARM resource discovery, Namespace-pull data-plane. Grep for
azure_trigger/AzureTrigger.
1. Database migration
Create a migration: cargo sqlx migrate add -r add_{kind}_trigger from backend/. Never write timestamps manually.
The up.sql usually defines:
- An optional enum type (e.g.
AZURE_MODE) if the trigger has sub-kinds - The
{kind}_triggertable with at minimum these columns (mirrored from kafka/gcp):- primary:
(workspace_id, path) script_path,is_flow,enabled,mode,permissioned_as,edited_by,emailedited_at,error,server_id,last_server_pingerror_handler_path,error_handler_args jsonb,retry jsonb- trigger-specific fields
- primary:
- Indexes on foreign keys + any frequently-filtered columns
- Foreign key to
workspace - The RLS policies (
see_own,see_member,see_folder_extra_perms_user_*,see_extra_perms_user_*,see_extra_perms_groups_*), copied from an existing trigger table
RLS: wrap every session GUC read in a scalar sub-select. Write the session
reads as (select current_setting('session.user')),
= any((select regexp_split_to_array(current_setting('session.groups'), ','))::text[]),
?| (select regexp_split_to_array(current_setting('session.pgroups'), ','))::text[],
? (select concat('u/', current_setting('session.user'))), etc. — not the bare
current_setting(...). The GUCs are set with SET LOCAL, so the sub-select
hoists them to a one-time InitPlan instead of re-evaluating per scanned row.
Put the ::text[] cast outside the sub-select for the array cases: in an
= any (...) context, casting inside — = any((select ...::text[])) — makes
Postgres parse the operand as a row-returning subquery and fails at CREATE with
operator does not exist: text = text[]. The outside cast keeps it in
array-operand form. See migration 20260714230440_wrap_session_gucs_in_rls_policies
for the canonical wrapped forms.
Down migration drops the table and any enum types.
2. Backend crate (windmill-trigger-{kind})
Create a new crate under backend/windmill-trigger-{kind}/ with:
Cargo.toml: featuresenterprise,privateif EE, standard depssrc/lib.rs:pub use mod_ee::*;behind#[cfg(all(feature = "enterprise", feature = "private"))]src/mod_ee.rs: core types + helperssrc/handler_ee.rs:TriggerCrudimpl + route handlerssrc/listener_ee.rs: (only if streaming/pull-based)Listenertrait impl. Retrying is the framework's job (listeninginwindmill-trigger/src/listener.rs): open the connection inget_consumerand return its error, which disables the trigger only whenis_transient_errorsays no retry can fix it (map a retryable failure with no natural kind totransient_error); haveconsumewrite the reason to its status lock and return when the connection drops, and calldisable_with_erroronly for a permanent failure. No retry loop or alerting of its own.
Required in mod_ee.rs:
{Kind}Configstruct (persisted shape,FromRow){Kind}ConfigRequeststruct (what API receives — usually similar to Config but with validation fields){Kind}Triggerunit struct (implements the traits)impl TriggerJobArgs for {Kind}Trigger— setsTRIGGER_KIND,Payload,v1_payload_fn
Required in handler_ee.rs:
#[async_trait] impl TriggerCrud for {Kind}Triggerwith:type Trigger = Trigger<{Kind}Config>type TriggerConfigRequest = {Kind}ConfigRequestconst ROUTE_PREFIX: &'static str = "/{kind}_triggers";const TABLE_NAME,ADDITIONAL_SELECT_FIELDSget_deployed_object,validate_config,create_trigger,update_trigger,delete_trigger,test_connectionadditional_routes(optional — mount extra endpoints for things like ARM resource listing, topic discovery)- `config_runnable
Установить adding-a-trigger в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл adding-a-trigger?
Checklist for adding a new TriggerCrud-based trigger type to Windmill (Azure, GCP, Kafka, etc.). Use when wiring a new trigger kind across backend, frontend, CLI, and capture infrastructure.
Как установить скилл adding-a-trigger?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл adding-a-trigger запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic