Twilio SendGridMailExecution

Twilio SendGridMailExecution

Certified

Email execution summary via SendGrid

Uses bundled HTML and text templates to email execution status, flow metadata, and a UI link through SendGrid. Intended for Flow-triggered alerts; for errors handlers, use SendGridMailSend instead.

yaml
type: io.kestra.plugin.twilio.sendgrid.SendGridMailExecution

Send an SendGrid email notification on a failed flow execution.

yaml
id: failure_alert
namespace: company.team

tasks:
  - id: send_alert
    type: io.kestra.plugin.twilio.sendgrid.SendGridMailExecution
    to:
      - hello@kestra.io
    from: hello@kestra.io
    subject: "The workflow execution {{trigger.executionId}} failed for the flow {{trigger.flowId}} in the namespace {{trigger.namespace}}"
    sendgridApiKey: "{{ secret('SENDGRID_API_KEY') }}"
    executionId: "{{ trigger.executionId }}"

triggers:
  - id: failed_prod_workflows
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespace
        namespace: prod
        prefix: true
Properties
Min length1

Sender email address

Must comply with RFC 2822 formatting

Min length1

SendGrid API key

API key used to authenticate SendGrid requests; store as a secret

SubTypestring
Min items1

Recipient email addresses

Each address must comply with RFC 2822 format

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

File attachments

List of files loaded from Kestra storage and attached to the email; delivered as downloadable attachments

Definitions
name*string

Attachment filename

Filename presented to recipients, e.g., 'report.pdf'

uri*string

Attachment URI

URI in Kestra internal storage that supplies the file content

contentTypestring
Defaultapplication/octet-stream

Attachment content type

MIME type for the attachment; defaults to application/octet-stream

SubTypestring

Cc recipients

Optional carbon-copy recipients in RFC 2822 format

Custom fields

Additional key-value pairs merged into the template context

Custom message

Optional message rendered into the template alongside execution details

Inline embedded images

Images loaded from storage and attached with inline disposition for HTML content

Definitions
name*string

Attachment filename

Filename presented to recipients, e.g., 'report.pdf'

uri*string

Attachment URI

URI in Kestra internal storage that supplies the file content

contentTypestring
Defaultapplication/octet-stream

Attachment content type

MIME type for the attachment; defaults to application/octet-stream

Default{{ execution.id }}

Execution ID

Defaults to the current execution ID using an expression

HTML body

Optional HTML content. When both HTML and text are provided, email clients treat them as alternatives and typically favor HTML.

Email subject

Optional subject line rendered from flow variables

Map of variables to use for the message template

Plain text body

Optional text content. When both HTML and text are provided, clients choose based on capability.

Response body returned by the SendGrid API

SubTypestring

Response headers returned by the SendGrid API

Default0

HTTP status code returned by the SendGrid API