native-trigger
БесплатноБез исполняемых скриптовНе проверенGuidance for adding native trigger services to Windmill. Use when implementing or modifying native trigger integrations across the backend and frontend.
от windmill-labs★ 18 798 звёзд на GitHubОб этом скилле
Skill: Adding Native Trigger Services
This skill provides comprehensive guidance for adding new native trigger services to Windmill. Native triggers allow external services (like Nextcloud, Google Drive, etc.) to trigger Windmill scripts/flows via webhooks or push notifications.
Architecture Overview
The native trigger system consists of:
- Database Layer - PostgreSQL tables and enum types
- Backend Rust Implementation - Core trait, handlers, and service modules in the
windmill-native-triggerscrate - Frontend Svelte Components - Configuration forms and UI components
Key Files
| Component | Path |
|---|---|
Core module with External trait |
backend/windmill-native-triggers/src/lib.rs |
| Generic CRUD handlers | backend/windmill-native-triggers/src/handler.rs |
| Background sync logic | backend/windmill-native-triggers/src/sync.rs |
| OAuth/workspace integration | backend/windmill-native-triggers/src/workspace_integrations.rs |
| Re-export shim (windmill-api) | backend/windmill-api/src/native_triggers/mod.rs |
| TriggerKind enum | backend/windmill-common/src/triggers.rs |
| JobTriggerKind enum | backend/windmill-common/src/jobs.rs |
| Frontend service registry | frontend/src/lib/components/triggers/native/utils.ts |
| Frontend trigger utilities | frontend/src/lib/components/triggers/utils.ts |
| Trigger badges (icons + counts) | frontend/src/lib/components/graph/renderers/triggers/TriggersBadge.svelte |
| Workspace integrations UI | frontend/src/lib/components/workspaceSettings/WorkspaceIntegrations.svelte |
| OAuth config form component | frontend/src/lib/components/workspaceSettings/OAuthClientConfig.svelte |
| OpenAPI spec | backend/windmill-api/openapi.yaml |
| Reference: Nextcloud module | backend/windmill-native-triggers/src/nextcloud/ |
| Reference: Google module | backend/windmill-native-triggers/src/google/ |
Crate Structure
The native trigger code lives in the windmill-native-triggers crate (backend/windmill-native-triggers/). The windmill-api crate re-exports everything via a shim:
// backend/windmill-api/src/native_triggers/mod.rs
pub use windmill_native_triggers::*;
All new service modules go in backend/windmill-native-triggers/src/.
Core Concepts
The External Trait
Every native trigger service implements the External trait defined in lib.rs:
#[async_trait]
pub trait External: Send + Sync + 'static {
// Associated types:
type ServiceConfig: Debug + DeserializeOwned + Serialize + Send + Sync;
type TriggerData: Debug + Serialize + Send + Sync;
type OAuthData: DeserializeOwned + Serialize + Clone + Send + Sync;
type CreateResponse: DeserializeOwned + Send + Sync;
// Constants:
const SUPPORT_WEBHOOK: bool;
const SERVICE_NAME: ServiceName;
const DISPLAY_NAME: &'static str;
const TOKEN_ENDPOINT: &'static str;
const REFRESH_ENDPOINT: &'static str;
const AUTH_ENDPOINT: &'static str;
// Required methods:
async fn create(&self, w_id, oauth_data, webhook_token, data, db, tx) -> Result<Self::CreateResponse>;
async fn update(&self, w_id, oauth_data, external_id, webhook_token, data, db, tx) -> Result<serde_json::Value>;
async fn get(&self, w_id, oauth_data, external_id, db, tx) -> Result<Self::TriggerData>;
async fn delete(&self, w_id, oauth_data, external_id, db, tx) -> Result<()>;
async fn exists(&self, w_id, oauth_data, external_id, db, tx) -> Result<bool>;
async fn maintain_triggers(&self, db, workspace_id, triggers, oauth_data, synced, errors);
fn external_id_and_metadata_from_response(&self, resp) -> (String, Option<serde_json::Value>);
// Methods with defaults:
async fn prepare_webhook(&self, db, w_id, headers, body, script_path, is_flow) -> Result<PushArgsOwned>;
fn service_config_from_create_response(&self, data, resp) -> Option<serde_json::Value>;
fn additional_routes(&self) -> axum::Router;
async fn http_client_request<T, B>(&self, url, method, workspace_id, connection_path, db, headers, body) -> Result<T>;
}
Key design points:
update()returnsserde_json::Value- the resolved service_config to store. Each service is responsible for building the final config.maintain_triggers()- periodic background maintenance. Each service implements its own strategy (Nextcloud: reconcile with external state; Google: renew expiring channels).- No
list_all()in the trait - services that need it (Nextcloud) implement it privately; services that don't (Google) use different maintenance strategies. - No
get_external_id_from_trigger_data()orextract_service_config_from_trigger_data()- removed in favor of themaintain_triggerspattern.
Create Lifecycle: Two Paths
The create_native_trigger handler in handler.rs supports two creation flows, controlled by service_config_from_create_response():
Path A: Short (Google pattern) - `s
Установить native-trigger в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл native-trigger?
Guidance for adding native trigger services to Windmill. Use when implementing or modifying native trigger integrations across the backend and frontend.
Как установить скилл native-trigger?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл native-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