|
| 1 | +/** |
| 2 | + * System subblock IDs that are part of the trigger UI infrastructure |
| 3 | + * and should NOT be aggregated into triggerConfig or validated as user fields. |
| 4 | + * |
| 5 | + * These subblocks provide UI/UX functionality but aren't configuration data. |
| 6 | + */ |
| 7 | +export const SYSTEM_SUBBLOCK_IDS: string[] = [ |
| 8 | + 'triggerCredentials', // OAuth credentials subblock |
| 9 | + 'triggerInstructions', // Setup instructions text |
| 10 | + 'webhookUrlDisplay', // Webhook URL display |
| 11 | + 'samplePayload', // Example payload display |
| 12 | + 'setupScript', // Setup script code (e.g., Apps Script) |
| 13 | + 'scheduleInfo', // Schedule status display (next run, last run) |
| 14 | +] |
| 15 | + |
| 16 | +/** |
| 17 | + * Trigger-related subblock IDs that represent runtime metadata. They should remain |
| 18 | + * in the workflow state but must not be modified or cleared by diff operations. |
| 19 | + * |
| 20 | + * Note: 'triggerConfig' is included because it's an aggregate of individual trigger |
| 21 | + * field subblocks. Those individual fields are compared separately, so comparing |
| 22 | + * triggerConfig would be redundant. Additionally, the client populates triggerConfig |
| 23 | + * with default values from the trigger definition on load, which aren't present in |
| 24 | + * the deployed state, causing false positive change detection. |
| 25 | + */ |
| 26 | +export const TRIGGER_RUNTIME_SUBBLOCK_IDS: string[] = [ |
| 27 | + 'webhookId', |
| 28 | + 'triggerPath', |
| 29 | + 'triggerConfig', |
| 30 | + 'triggerId', |
| 31 | +] |
| 32 | + |
| 33 | +/** |
| 34 | + * Maximum number of consecutive failures before a trigger (schedule/webhook) is auto-disabled. |
| 35 | + * This prevents runaway errors from continuously executing failing workflows. |
| 36 | + */ |
| 37 | +export const MAX_CONSECUTIVE_FAILURES = 100 |
| 38 | + |
1 | 39 | /** |
2 | 40 | * Set of webhook provider names that use polling-based triggers. |
3 | 41 | * Mirrors the `polling: true` flag on TriggerConfig entries. |
|
0 commit comments