Skip to main content

Workflow Interaction Layer (WIL) — External UI

Overview

The Workflow Interaction Layer (WIL) is the user-facing interface that allows authenticated users to interact with n8n workflow actions and messages. It bridges the gap between automated workflow executions and human decision points — approvals, form submissions, event acknowledgements, and notifications.

WIL is implemented across two packages:

  • external-hooks (Express backend mounted on n8n) — provides the /ui-api/wil/ REST API with tenant-scoped, actor-filtered endpoints.
  • external-ui (React/Vite SPA) — provides the /workflow-interaction page with a split-pane layout for browsing and interacting with actions.

Key Principles

  1. Sensitive data stays server-side. Callback URLs, FormAPIKeys, and internal metadata never reach the browser.
  2. Tenant-scoped access. Every request is scoped to a tenant via the X-TENANT-ID header, resolved to project IDs.
  3. Actor-based filtering. Actions and messages are matched to the logged-in user by email/OIDC subject (actor_type = 'user'), by any CSTAR role they hold in the tenant (actor_type = 'role'), or by any CSTAR group they belong to in the tenant (actor_type = 'group'). A single OR query covers all three in one database round-trip.
  4. Security through proxying. The callback proxy pattern ensures the frontend cannot forge upstream webhook calls or discover internal URLs.

Documentation Index

DocumentDescription
ArchitectureSystem diagram, component hierarchy, and data flow
Authentication & TokensOIDC session, CHEFS token exchange, user context passing
CHEFS IntegrationChefsFormViewer component, script loading, prefill & submission
Action HandlersGetApproval, ShowForm, WaitOnEvent — behavior and design
Backend APIWIL router endpoints, callback proxy, response shaping
Future WorkWorkflow triggers, claim/unclaim, auto-expiry, and more

Quick Reference

Supported Action Types

TypeUser Experience
getapprovalView HTML content, click an approval option
showformFill and submit an embedded CHEFS form
waitoneventClick a single confirmation button

API Endpoints

MethodPathPurpose
GET/ui-api/wil/tenantsList available tenants
GET/ui-api/wil/actionsList actions (tenant-scoped, actor-filtered)
GET/ui-api/wil/messagesList messages (tenant-scoped, actor-filtered)
POST/ui-api/wil/callbackProxy interaction response upstream
POST/ui-api/wil/chefs-tokenExchange FormAPIKey for short-lived CHEFS JWT