From a83024e0fff6f78eacd9edf5e7c7481a60091dc9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Mar 2026 11:02:12 +0000 Subject: [PATCH 1/2] Disable concurrency input when sync (response) mode is enabled When a workflow's trigger uses sync/response mode (webhook_reply: after_completion), the concurrency setting is not respected, so we disable the input and show an info icon tooltip plus explanatory text. https://claude.ai/code/session_01A2Cryi5yc1wWpYiS1tT5E8 --- .../components/inspector/WorkflowSettings.tsx | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx b/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx index be293c00b13..2a982d8daf5 100644 --- a/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx +++ b/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx @@ -16,6 +16,7 @@ import { createWorkflowSchema } from '#/collaborative-editor/types/workflow'; import { useURLState } from '#/react/lib/use-url-state'; import { AlertDialog } from '../AlertDialog'; +import { Tooltip } from '../Tooltip'; export function WorkflowSettings() { // Get workflow from store - LoadingBoundary guarantees it's non-null @@ -35,6 +36,11 @@ export function WorkflowSettings() { // Check if project has concurrency disabled (concurrency === 1) const isProjectConcurrencyDisabled = projectConcurrency === 1; + const triggers = useWorkflowState(state => state.triggers); + const isSyncMode = + triggers[0]?.type === 'webhook' && + triggers[0]?.webhook_reply === 'after_completion'; + const handleViewAsYAML = () => { updateSearchParams({ panel: 'code' }); }; @@ -135,7 +141,17 @@ export function WorkflowSettings() { {/* Concurrency Section */}
-

Concurrency

+
+

Concurrency

+ {isSyncMode && ( + + + + )} +

Control how many of this workflow's Runs are executed at the same time @@ -153,9 +169,18 @@ export function WorkflowSettings() { } min={1} max={projectConcurrency ?? undefined} - disabled={isReadOnly || isProjectConcurrencyDisabled} + disabled={isReadOnly || isProjectConcurrencyDisabled || isSyncMode} /> - {isProjectConcurrencyDisabled && ( + {isSyncMode && ( +

+
+ This workflow's trigger uses sync (response) mode, which + holds the HTTP connection open until the run completes. + Concurrency is not respected in this mode. +
+
+ )} + {!isSyncMode && isProjectConcurrencyDisabled && (
Parallel execution of runs is disabled for this project. From 1373fcb88eb855918d61db90be1a2a4ad9846c18 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Wed, 1 Apr 2026 08:44:21 +0200 Subject: [PATCH 2/2] eish, complicated but correct --- .../components/form/form-field.tsx | 2 +- .../components/form/number-field.tsx | 2 +- .../components/inspector/WorkflowSettings.tsx | 39 +++++++++---------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/assets/js/collaborative-editor/components/form/form-field.tsx b/assets/js/collaborative-editor/components/form/form-field.tsx index 7be746b2654..31e00378302 100644 --- a/assets/js/collaborative-editor/components/form/form-field.tsx +++ b/assets/js/collaborative-editor/components/form/form-field.tsx @@ -5,7 +5,7 @@ export const INPUT_CLASSES = interface FormFieldProps { name: string; - label: string; + label: React.ReactNode; meta: any; // TanStack Form meta type helpText?: string | undefined; children: React.ReactNode; diff --git a/assets/js/collaborative-editor/components/form/number-field.tsx b/assets/js/collaborative-editor/components/form/number-field.tsx index 6a858a04ed8..ee5f848b1d1 100644 --- a/assets/js/collaborative-editor/components/form/number-field.tsx +++ b/assets/js/collaborative-editor/components/form/number-field.tsx @@ -3,7 +3,7 @@ import { FormField, INPUT_CLASSES } from './form-field'; import { useFieldContext } from '.'; interface NumberFieldProps { - label: string; + label: React.ReactNode; placeholder?: string | undefined; disabled?: boolean | undefined; min?: number | undefined; diff --git a/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx b/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx index 2a982d8daf5..d1544810f1c 100644 --- a/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx +++ b/assets/js/collaborative-editor/components/inspector/WorkflowSettings.tsx @@ -141,26 +141,21 @@ export function WorkflowSettings() { {/* Concurrency Section */}
-
-

Concurrency

- {isSyncMode && ( - - - - )} -
-

- Control how many of this workflow's Runs are executed at the - same time -

{field => ( <> + Max Concurrency + + + + + } placeholder="Unlimited (up to max available)" helpText={ field.state.value === null @@ -169,14 +164,18 @@ export function WorkflowSettings() { } min={1} max={projectConcurrency ?? undefined} - disabled={isReadOnly || isProjectConcurrencyDisabled || isSyncMode} + disabled={isReadOnly || isProjectConcurrencyDisabled} /> {isSyncMode && (
- This workflow's trigger uses sync (response) mode, which - holds the HTTP connection open until the run completes. - Concurrency is not respected in this mode. + + This workflow uses a sync-mode trigger. Because sync-mode is + time sensitive, most OpenFn instances ignore concurrency + limits for these workflows and process as many as possible + at once. (You may set this setting, but as your OpenFn host + scales the workers and adjusts their priorities over time it + may not have any impact.)
)}