native-trigger

Implements new native trigger services across Windmill's Rust backend and Svelte frontend.

17.8k|1.1k|Updated May 5, 2022
One-click install
npx skills add https://github.com/windmill-labs/windmill --skill native-trigger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-trigger
Source: https://github.com/windmill-labs/windmill/tree/main/.agents/skills/native-trigger
Command: npx skills add https://github.com/windmill-labs/windmill --skill native-trigger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new native trigger integration to Windmill requires coordinated changes across database migrations, Rust backend crates, OAuth token storage, and multiple Svelte frontend components, which is error-prone without a complete map of every touchpoint.

Core Features & Use Cases

  • End-to-End Implementation Guide: Walks through all 18 steps from SQL enum migrations and the External trait implementation to frontend registries, icons, and OpenAPI regeneration.
  • Architectural Patterns: Documents the two create lifecycles (short Google pattern vs. long Nextcloud update+get pattern), the three-table OAuth token storage model, and background sync strategies (reconciliation vs. channel renewal).
  • Use Case: When adding a new webhook-based integration like a file storage or calendar service, follow the guide to implement the Rust service module in windmill-native-triggers, wire up routes and sync logic, and register the trigger form, icon, and sidebar visibility in the frontend.

Quick Start

Use the native-trigger skill to add a new native trigger service integration to Windmill covering the backend crate, database migration, and frontend components.

Frequently Asked Questions about native-trigger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new native trigger service to Windmill?

Add SQL enum migrations, implement the External trait in a new module under backend/windmill-native-triggers/src, register it in lib.rs, handler.rs, and sync.rs, then add frontend form, icon, and registry entries. The skill documents all 18 steps including OpenAPI regeneration.

What is the External trait in Windmill native triggers?

The External trait defines the contract every native trigger service implements, including create, update, get, delete, exists, and maintain_triggers methods plus associated types for service config, trigger data, and OAuth data. It lives in backend/windmill-native-triggers/src/lib.rs.

How are OAuth tokens stored for Windmill native triggers?

OAuth tokens use a three-table pattern: workspace_integrations holds base_url and client credentials metadata, the variable table stores the encrypted access_token, and the account table stores the refresh_token. The decrypt_oauth_data() function assembles these into a unified OAuthConfig struct.

When should I use the Google pattern versus the Nextcloud pattern for trigger creation?

Use the Google pattern when the external_id is known before creation, overriding service_config_from_create_response() to skip the update+get cycle. Use the Nextcloud pattern when the remote service assigns the ID and the webhook URL must be corrected via update() after creation.

Why does my native trigger not appear in the Windmill sidebar?

The sidebar only shows native trigger links when get_used_triggers returns your service. You must add a {service}_used boolean to the UsedTriggers struct in workspaces.rs, update the OpenAPI response schema, and destructure it in the frontend layout's loadUsedTriggerKinds function.