{#if flowModule.id === selectedId} {#if flowModule.value.type === 'forloopflow'} {:else if flowModule.value.type === 'whileloopflow'} {:else if flowModule.value.type === 'branchone'} {:else if flowModule.value.type === 'branchall'} {:else if flowModule.value.type === 'identity'} {#if selectedId == 'failure'}
If defined, the error handler will take the error as input.
{:else if selectedId == 'preprocessor'}
It prepares arguments for the flow. Besides request arguments, the preprocessor receives a `wm_trigger` argument with trigger details.
{/if} {#if flowModule.value.flow} { const { path, summary } = detail const [module, state] = await pickFlow(path, summary, flowModule.id, opWorkspace?.()) flowModule = module flowStateStore.val[module.id] = state }} /> {:else} { const { path, summary, kind, hash } = detail // The picked script's summary is a default: anything already typed on the step // was the user's choice and outranks it. createModuleFromScript( path, emptyString(flowModule.summary) ? summary : flowModule.summary, kind, hash ) }} on:new={async ({ detail }) => { const { language, kind, subkind, summary } = detail const [module, state] = await createInlineScriptModule( language, kind, subkind, flowModule.id, summary ) scriptKind = kind scriptTemplate = subkind if (kind == 'trigger') { initializePrimaryScheduleForTriggerScript(module) } if (kind == 'approval') { module.suspend = stepSettingDefaults('suspend') } flowModule = module flowStateStore.val[module.id] = state }} failureModule={selectedId === 'failure'} preprocessorModule={selectedId === 'preprocessor'} /> {/if} {:else if flowModule.value.type === 'rawscript' || flowModule.value.type === 'script' || flowModule.value.type === 'flow' || flowModule.value.type === 'aiagent'} {/if} {:else if flowModule.value.type === 'forloopflow' || flowModule.value.type == 'whileloopflow'} {#each flowModule.value.modules as child, index (child.id ?? index)} {@const slot = moduleSlot( () => (flowModule.value as { modules: FlowModule[] }).modules, child.id, child )} {/each} {:else if flowModule.value.type === 'branchone'} {#if selectedId === `${flowModule?.id}-branch-default`}

Nothing to configure — this branch runs when none of the predicates match.

{:else} {#each flowModule.value.default as child, index (child.id ?? index)} {@const slot = moduleSlot( () => (flowModule.value as { default: FlowModule[] }).default, child.id, child )} {/each} {/if} {#each flowModule.value.branches as branch, branchIndex (branch)} {#if selectedId === `${flowModule?.id}-branch-${branchIndex}`} {:else} {#each branch.modules as child, index (child.id ?? index)} {@const slot = moduleSlot(() => branch.modules, child.id, child)} {/each} {/if} {/each} {:else if flowModule.value.type === 'branchall'} {#each flowModule.value.branches as branch, branchIndex (branch)} {#if selectedId === `${flowModule?.id}-branch-${branchIndex}`} {:else} {#each branch.modules as child, index (child.id ?? index)} {@const slot = moduleSlot(() => branch.modules, child.id, child)} {/each} {/if} {/each} {:else if flowModule.value.type === 'aiagent'} {#each flowModule.value.tools ?? [] as tool, toolIndex (toolIndex)} {#if selectedId === tool.id} t.summary ?? '')} /> {/if} {/each} {/if}