Skip to content

Commit 8ee4c59

Browse files
committed
inline child triggers
1 parent d5fbc3c commit 8ee4c59

File tree

1 file changed

+4
-2
lines changed
  • apps/sim/app/api/workflows/[id]/execute

1 file changed

+4
-2
lines changed

apps/sim/app/api/workflows/[id]/execute/route.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ const ExecuteWorkflowSchema = z.object({
118118
export const runtime = 'nodejs'
119119
export const dynamic = 'force-dynamic'
120120

121+
const INLINE_TRIGGER_TYPES = new Set<CoreTriggerType>(['manual', 'workflow'])
122+
121123
function resolveOutputIds(
122124
selectedOutputs: string[] | undefined,
123125
blocks: Record<string, any>
@@ -789,7 +791,7 @@ async function handleExecutePost(
789791

790792
const executionVariables = cachedWorkflowData?.variables ?? workflow.variables ?? {}
791793

792-
if (shouldUseBullMQ() && triggerType !== 'manual') {
794+
if (shouldUseBullMQ() && !INLINE_TRIGGER_TYPES.has(triggerType)) {
793795
try {
794796
const dispatchJobId = await enqueueDirectWorkflowExecution(
795797
{
@@ -989,7 +991,7 @@ async function handleExecutePost(
989991
}
990992

991993
if (shouldUseDraftState) {
992-
const shouldDispatchViaQueue = shouldUseBullMQ() && triggerType !== 'manual'
994+
const shouldDispatchViaQueue = shouldUseBullMQ() && !INLINE_TRIGGER_TYPES.has(triggerType)
993995
if (shouldDispatchViaQueue) {
994996
const metadata: ExecutionMetadata = {
995997
requestId,

0 commit comments

Comments
 (0)