{#snippet stopStatusPicker(stop: StopAfterIf)}
{#if stop.error_message != undefined}
stop.error_message ?? '', (v) => (stop.error_message = String(v))} inputProps={{ placeholder: 'Enter custom error message (optional)' }} /> stop.error_include_result ?? false, (v) => (stop.error_include_result = v) } options={{ right: 'Include result in error', rightTooltip: "When enabled, this step's output is embedded inside the raised error object (as error.result) instead of being discarded. The flow result stays { error }." }} />
{/if}
{/snippet} {#snippet stopAfterToggle()} { if (isStopAfterIfEnabled && flowModule.stop_after_if) { flowModule.stop_after_if = undefined } else { flowModule.stop_after_if = stepSettingDefaults('early-stop') } }} options={{ title: isParallelLoop ? stopAfterCopy.tooltip : undefined, right: stopAfterCopy.label, rightTooltip: stopAfterCopy.tooltip, rightDocumentationLink: 'https://www.windmill.dev/docs/flows/early_stop' }} /> {/snippet} {#snippet stopAfterAllItersToggle()} { if (isStopAfterAllIterationsEnabled && flowModule.stop_after_all_iters_if) { flowModule.stop_after_all_iters_if = undefined } else { flowModule.stop_after_all_iters_if = stepSettingDefaults('early-stop') } }} options={{ right: stopAfterAllItersCopy.label, rightTooltip: stopAfterAllItersCopy.tooltip, rightDocumentationLink: 'https://www.windmill.dev/docs/flows/early_stop' }} /> {/snippet}
{#if blocks !== 'all-iters' && !isBranchAll}
{ stopAfterEditor?.insertAtCursor(detail) stopAfterEditor?.focus() }} > flowModule.stop_after_if, (v) => { flowModule.stop_after_if = v } } argName="stop_after_if" argType="javascript" collapsed={!isStopAfterIfEnabled || isParallelLoop} animateAppear header={stopAfterToggle} noDynamicToggle schema={predicateSchema} previousModuleId={undefined} pickableProperties={stepPropPicker.pickableProperties} extraLib={`declare const result = ${JSON.stringify(earlyStopResult)};\n` + stepPropPicker.extraLib + (isLoop ? `\ndeclare const all_iters = ${JSON.stringify(result)};` : '')} bind:editor={stopAfterEditor} /> {#if isStopAfterIfEnabled && !breakableParent && !isLoop && flowModule.stop_after_if} {@render stopStatusPicker(flowModule.stop_after_if)} {/if}
{/if} {#if blocks !== 'stop-after' && (isLoop || isBranchAll)}
{ stopAfterAllItersEditor?.insertAtCursor(detail) stopAfterAllItersEditor?.focus() }} > flowModule.stop_after_all_iters_if, (v) => { flowModule.stop_after_all_iters_if = v } } argName="stop_after_all_iters_if" argType="javascript" collapsed={!isStopAfterAllIterationsEnabled} animateAppear header={stopAfterAllItersToggle} noDynamicToggle schema={predicateSchema} previousModuleId={undefined} pickableProperties={stepPropPicker.pickableProperties} extraLib={`declare const result = ${JSON.stringify(result)};\n` + stepPropPicker.extraLib} bind:editor={stopAfterAllItersEditor} /> {#if isStopAfterAllIterationsEnabled && !breakableParent && flowModule.stop_after_all_iters_if} {@render stopStatusPicker(flowModule.stop_after_all_iters_if)} {/if}
{/if}