@@ -4,8 +4,9 @@ import { validate as uuidValidate, v4 as uuidv4 } from 'uuid'
44import { z } from 'zod'
55import { AuthType , checkHybridAuth , hasExternalApiCredentials } from '@/lib/auth/hybrid'
66import { admissionRejectedResponse , tryAdmit } from '@/lib/core/admission/gate'
7- import { getJobQueue , shouldExecuteInline , shouldUseBullMQ } from '@/lib/core/async-jobs'
8- import { createBullMQJobData } from '@/lib/core/bullmq'
7+ import { getJobQueue } from '@/lib/core/async-jobs'
8+ import { createBullMQJobData , isBullMQEnabled } from '@/lib/core/bullmq'
9+ import { isTriggerDevEnabled } from '@/lib/core/config/feature-flags'
910import {
1011 createTimeoutAbortController ,
1112 getTimeoutErrorMessage ,
@@ -216,7 +217,7 @@ async function handleAsyncExecution(params: AsyncExecutionParams): Promise<NextR
216217 }
217218
218219 try {
219- const useBullMQ = shouldUseBullMQ ( )
220+ const useBullMQ = isBullMQEnabled ( )
220221 const jobQueue = useBullMQ ? null : await getJobQueue ( )
221222 const jobId = useBullMQ
222223 ? await enqueueWorkspaceDispatch ( {
@@ -242,7 +243,7 @@ async function handleAsyncExecution(params: AsyncExecutionParams): Promise<NextR
242243
243244 asyncLogger . info ( 'Queued async workflow execution' , { jobId } )
244245
245- if ( shouldExecuteInline ( ) && jobQueue ) {
246+ if ( ! isBullMQEnabled ( ) && ! isTriggerDevEnabled && jobQueue ) {
246247 const inlineJobQueue = jobQueue
247248 void ( async ( ) => {
248249 try {
@@ -793,7 +794,7 @@ async function handleExecutePost(
793794
794795 const executionVariables = cachedWorkflowData ?. variables ?? workflow . variables ?? { }
795796
796- if ( shouldUseBullMQ ( ) && ! INLINE_TRIGGER_TYPES . has ( triggerType ) ) {
797+ if ( isBullMQEnabled ( ) && ! INLINE_TRIGGER_TYPES . has ( triggerType ) ) {
797798 try {
798799 const dispatchJobId = await enqueueDirectWorkflowExecution (
799800 {
@@ -993,7 +994,7 @@ async function handleExecutePost(
993994 }
994995
995996 if ( shouldUseDraftState ) {
996- const shouldDispatchViaQueue = shouldUseBullMQ ( ) && ! INLINE_TRIGGER_TYPES . has ( triggerType )
997+ const shouldDispatchViaQueue = isBullMQEnabled ( ) && ! INLINE_TRIGGER_TYPES . has ( triggerType )
997998 if ( shouldDispatchViaQueue ) {
998999 const metadata : ExecutionMetadata = {
9991000 requestId,
0 commit comments