Files
sim/apps/sim/executor/consts.ts
Vikhyath Mondreti 5ee66252ed feat(webhook-triggers): multiple webhook trigger blocks (#725)
* checkpoint

* correctly clear status

* works

* improvements

* fix build issue

* add docs

* remove comments, logs

* fix migration to have foreign ref key

* change filename to snake case

* modified dropdown to match combobox styling

* added block type for triggers, split out schedule block into a separate trigger

* added chat trigger to start block, removed startAt from schedule modal, added chat fields into tag dropdown for start block

* removed startedAt for schedules, separated schedules into a separate block, removed unique constraint on scheule workflows and added combo constraint on workflowid/blockid and schedule

* icons fix

---------

Co-authored-by: Waleed Latif <walif6@gmail.com>
2025-07-19 21:22:51 -07:00

32 lines
790 B
TypeScript

/**
* Enum defining all supported block types in the executor.
* This centralizes block type definitions and eliminates magic strings.
*/
export enum BlockType {
PARALLEL = 'parallel',
LOOP = 'loop',
ROUTER = 'router',
CONDITION = 'condition',
FUNCTION = 'function',
AGENT = 'agent',
API = 'api',
EVALUATOR = 'evaluator',
RESPONSE = 'response',
WORKFLOW = 'workflow',
STARTER = 'starter',
SCHEDULE = 'schedule',
WEBHOOK_TRIGGER = 'webhook_trigger',
}
/**
* Array of all block types for iteration and validation
*/
export const ALL_BLOCK_TYPES = Object.values(BlockType) as string[]
/**
* Type guard to check if a string is a valid block type
*/
export function isValidBlockType(type: string): type is BlockType {
return ALL_BLOCK_TYPES.includes(type)
}