Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ const WorkflowContent = React.memo(() => {

// Create the trigger block at the center of the viewport
const centerPosition = project({ x: window.innerWidth / 2, y: window.innerHeight / 2 })
const id = `${triggerId}_${Date.now()}`
const id = crypto.randomUUID()

// Add the trigger block with trigger mode if specified
addBlock(
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/api_trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { BlockConfig } from '@/blocks/types'

export const ApiTriggerBlock: BlockConfig = {
type: 'api_trigger',
triggerAllowed: true,
name: 'API',
description: 'Expose as HTTP API endpoint',
longDescription:
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/chat_trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ChatTriggerIcon = (props: SVGProps<SVGSVGElement>) => createElement(Messag

export const ChatTriggerBlock: BlockConfig = {
type: 'chat_trigger',
triggerAllowed: true,
name: 'Chat',
description: 'Start workflow from a chat deployment',
longDescription: 'Chat trigger to run the workflow via deployed chat interfaces.',
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/input_trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const InputTriggerIcon = (props: SVGProps<SVGSVGElement>) => createElement(FormI

export const InputTriggerBlock: BlockConfig = {
type: 'input_trigger',
triggerAllowed: true,
name: 'Input Form',
description: 'Start workflow manually with a defined input schema',
longDescription:
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/manual_trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ManualTriggerIcon = (props: SVGProps<SVGSVGElement>) => createElement(Play

export const ManualTriggerBlock: BlockConfig = {
type: 'manual_trigger',
triggerAllowed: true,
name: 'Manual',
description: 'Start workflow manually from the editor',
longDescription:
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ScheduleIcon = (props: SVGProps<SVGSVGElement>) => createElement(Clock, pr

export const ScheduleBlock: BlockConfig = {
type: 'schedule',
triggerAllowed: true,
name: 'Schedule',
description: 'Trigger workflow execution on a schedule',
longDescription:
Expand Down
7 changes: 6 additions & 1 deletion apps/sim/lib/workflows/autolayout/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TriggerUtils } from '@/lib/workflows/triggers'
import type { BlockState } from '@/stores/workflows/workflow/types'
import type { BlockDimensions, BoundingBox } from './types'

Expand Down Expand Up @@ -70,5 +71,9 @@ export function getBlocksByParent(blocks: Record<string, BlockState>): {
}

export function isStarterBlock(block: BlockState): boolean {
return block.type === 'starter' || block.type === 'webhook' || block.type === 'schedule'
if (TriggerUtils.isTriggerBlock({ type: block.type, triggerMode: block.triggerMode })) {
return true
}

return block.triggerMode === true
}