{#snippet children({ item })} {#if !isVariableExpiration} {/if} {#if showInstanceAlerts} {/if} {/snippet}
{#if draft.selected === 'custom'}
{#if !draft.custom.path} {/if}
{#if showScriptHelpText}
Example of error handler scripts can be found on Windmill Hub
{/if}
{#if draft.custom.path}

Extra arguments

{#await import('$lib/components/SchemaForm.svelte')} {:then Module} {/await} {#if customHandlerSchema && customHandlerSchema.properties && Object.keys(customHandlerSchema.properties).length === 0}
This handler takes no extra arguments
{/if}
{/if} {:else if draft.selected === 'slack'} {#if workspaceConnectedToSlack} { draft.slack.path = e.detail ? builtinHubPath(errorOrRecovery, 'slack') : undefined }} /> {/if} {#if workspaceConnectedToSlack && draft.slack.path}
{#await import('$lib/components/SchemaForm.svelte')} {:then Module} {/await} {#if $enterpriseLicense} {#if connectionTestJob !== undefined}

{#if connectionTestJob.in_progress} Sending message... {:else if connectionTestJob.is_success} Message sent via Windmill job {:else} Message not sent {/if} {connectionTestJob.uuid}

{/if} {/if}
{:else if workspaceConnectedToSlack == undefined} {/if} {:else if draft.selected === 'teams'} {#if workspaceConnectedToTeams} { draft.teams.path = e.detail ? builtinHubPath(errorOrRecovery, 'teams') : undefined }} /> {/if} {#if workspaceConnectedToTeams}

Teams Channel

{ draft.teams.args['channel'] = channel?.channel_id draft.teams.args['channel_name'] = channel?.channel_name }} onError={(e) => sendUserToast('Failed to load channels: ' + e.message, true)} />
{#if $enterpriseLicense && draft.teams.path && workspaceConnectedToTeams} {#if connectionTestJob !== undefined}

{#if connectionTestJob.in_progress} {:else if connectionTestJob.is_success} {:else} {/if} Message sent via Windmill job {connectionTestJob.uuid}

{/if} {/if}
{:else if workspaceConnectedToTeams == undefined} {/if} {:else if draft.selected === 'email'} {#if isCloudHosted()} Email notifications for trigger failures are only available in self-hosted Windmill instances. {:else}
draft.email.args.email_recipients ?? [], (recipients) => (draft.email.args.email_recipients = recipients) } placeholder="Enter email addresses..." onCreateItem={(email) => { const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ if (!emailRegex.test(email)) { sendUserToast('Invalid email format', true) return } draft.email.args.email_recipients = [ ...(draft.email.args.email_recipients ?? []), email ] }} class="w-full" /> {#if draft.email.args.email_recipients?.length > 0} {draft.email.args.email_recipients.length} email{draft.email.args.email_recipients .length === 1 ? '' : 's'} configured {/if}
{/if} {:else if draft.selected === 'instance_alerts'}
Failed jobs are reported to the Slack, Teams and email channels configured at the instance level. Those channels are managed in instance settings by a superadmin, not here, and the report is sent without adding an entry to the instance critical alert feed. Canceled jobs are not reported. Configure the instance critical alert channels
{/if}