Skip to main content

AWS SES ExecModule

Overview

AwsSesModule brings governed Amazon Simple Email Service delivery into ValkyrAI workflows. It follows n8n's AWS SES email and template model while adding verified IntegrationAccount enforcement, operation-specific validation, bounded recipients and content, opaque pagination, read-only retry, single-attempt delivery and template writes, explicit deletion confirmation, normalized receipts, provider-error redaction, and annotation-backed Workflow Studio discovery.

The connector implements nine operations:

  • send_email sends one plain-text, HTML, or multipart-alternative transactional message.
  • send_templated_email sends one existing SES template with flat bounded JSON data.
  • list_templates, get_template, create_template, update_template, and confirmed delete_template manage reusable SES templates.
  • list_identities discovers sender identities by email address or domain.
  • get_send_quota returns the current regional sending quota and usage snapshot.

The connector does not send raw MIME, accept attachments, create or verify identities, manage suppression lists, configure event destinations, create configuration sets, or expose SES SMTP credentials. Those operations are deliberately deferred to narrower reviewed modules.

Usage

  1. Verify the sending domain or email address in the exact SES region used by the workflow.
  2. If the account is still in the SES sandbox, verify every recipient or request production access before customer delivery.
  3. Create an AWS IAM principal restricted to the SES actions, regions, identities, and templates the workflow needs.
  4. Store its access key ID and secret access key in an AWS IntegrationAccount, verify the account, and keep it in READY status.
  5. Add AwsSesModule to a workflow and bind that account through ExecModuleConfig.authConfig.integrationAccount.
  6. Choose one documented operation and provide only its accepted fields. Unexpected fields fail before provider access.
  7. Gate send and template-mutation operations with the workflow's normal outbound approval and reconciliation policy.

Never place AWS access keys, SMTP credentials, or session tokens in module input. Credential-shaped input fields are rejected before any SES request.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNoneOne of the nine documented operations.
regionstringEvery executionNoneAWS region such as us-west-2; custom endpoints are not accepted.
sourcestringBoth send operationsNonePlain verified sender email; no display-name or header syntax.
toAddressesarrayBoth send operationsNoneOne or more unique email addresses.
ccAddressesarrayOptional send field[]Unique across To, CC, and BCC.
bccAddressesarrayOptional send field[]Unique across To, CC, and BCC.
replyToAddressesarrayOptional send field[]Bounded plain email addresses.
returnPathstringOptional send fieldSES defaultVerified bounce/complaint forwarding address.
subjectstringsend_emailNoneNon-blank UTF-8, no control characters, at most 998 code points.
textBodystringOptional send_email bodyNonePlain text; either this or htmlBody is required.
htmlBodystringOptional send_email bodyNoneHTML body; either this or textBody is required.
templateNamestringTemplate send/get/create/update/deleteNone1-64 letters, digits, underscores, or hyphens.
templateDataobjectOptional send_templated_email data{}At most 100 flat scalar values and 100,000 serialized JSON bytes.
subjectPartstringRequired for create; optional updateNoneTemplate subject, at most 998 code points.
textPartstringTemplate create/updateNonePlain-text template body.
htmlPartstringTemplate create/updateNoneHTML template body.
configurationSetNamestringOptional send fieldNoneExisting SES configuration-set name using the bounded name format.
paginationTokenstringOptional list fieldNoneOpaque SES token, at most 4,096 characters.
limitintegerOptional list field100From 1 through 1,000.
returnAllbooleanOptional list fieldfalseFollow pages until limit or provider exhaustion.
identityTypestringOptional list_identities filterallall, email_address, or domain.
confirmDeletebooleandelete_templatefalseMust be exactly true before permanent deletion.

The combined To, CC, and BCC audience is capped at 50 recipients. Subject plus content, or the combined template parts, is capped at 9 MiB before SES encoding so the connector stays below the provider's classic API envelope limit. The module rejects duplicate recipients case-insensitively and rejects nested template data rather than silently flattening it.

Outputs

Every execution returns stable status, operation, and attempts fields.

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation.
attemptsintegerAlwaysProvider calls, including list pages and retry-safe read attempts.
resultTypestringSuccessmessage, templates, template, identities, or quota.
itemsarrayList successBounded normalized template metadata or identity values.
countintegerList successNumber of returned items.
hasMorebooleanList successWhether SES returned another continuation token.
paginationTokenstringAnother page existsOpaque SES continuation token.
dataobjectNon-list successMessage receipt, template content/mutation receipt, or quota values.
requestIdstringAWS supplies oneBounded provider reference for reconciliation and support.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

Successful sends return only the SES messageId, recipient count, and template name when applicable. Email bodies and template data are not echoed. Template reads can return bounded subject/text/HTML parts and must remain in an ACL-scoped workflow.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

FieldRequirement
ProviderAmazon Web Services / Simple Email Service
statusMust be READY.
verifiedMust be true.
apiKey SecureFieldAWS access key ID.
password SecureFieldAWS secret access key.

Grant only the actions enabled in the workflow:

  • Delivery: ses:SendEmail and, for template sends, ses:SendTemplatedEmail.
  • Templates: ses:ListTemplates, GetTemplate, CreateTemplate, UpdateTemplate, and DeleteTemplate as needed.
  • Discovery: ses:ListIdentities and ses:GetSendQuota.

Use IAM conditions such as ses:FromAddress, ses:Recipients, and ses:FromDisplayName where they fit the delivery policy. The current connector supports a long-lived access-key pair. Temporary session credentials, STS role assumption, workload identity, custom endpoints, and explicit sending-authorization ARNs are deferred.

Configuration

The awsAccount relationship is the only credential configuration. Operation, region, sender, audience, and content fields belong in mapped input or module parameters.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-ses-production"
},
"payloadConfig": {
"parameters": "{\"operation\":\"send_templated_email\",\"region\":\"us-west-2\",\"templateName\":\"OrderReady\"}"
}
}

The relationship value is illustrative. Persisted workflows bind the generated IntegrationAccount relationship, never plaintext credentials.

Operations

OperationProvider behaviorSide effect and retry behavior
send_emailSends one UTF-8 message with text and/or HTML.External side effect, exactly one provider attempt, no automatic replay.
send_templated_emailRenders and sends an existing SES template.External side effect, exactly one provider attempt; rendering failures may be asynchronous.
list_templatesReturns bounded template metadata and an opaque token.Read-only; each page retries transient failures up to three attempts.
get_templateRetrieves one exact template and bounded content parts.Read-only; bounded retry.
create_templateCreates one named template.Single attempt; reconcile by exact template name before replay.
update_templateReplaces supplied template parts.Single attempt; read the exact template before replay.
delete_templatePermanently deletes one template after confirmDelete=true.Destructive, single attempt, no automatic replay.
list_identitiesReturns bounded verified/pending identity names by optional type.Read-only; bounded pagination and retry.
get_send_quotaReturns regional daily maximum, rate, and last-24-hour usage.Read-only; bounded retry.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing/malformed region, sender, recipient, content, template, pagination field, identity filter, or confirmation; unexpected operation field.NoCorrect the named input; no provider request was sent.
UNSUPPORTED_OPERATIONUnknown operation.NoSelect a documented operation.
INTEGRATION_ACCOUNT_ERRORAccount missing, unverified, not READY, or missing key material.NoRepair and bind the AWS account.
AWS_SES_HTTP_400Address not verified, sandbox recipient restriction, invalid template data, rendering setup, or provider constraint.Usually noInspect exact region, identity, sandbox state, template, and recipient policy.
AWS_SES_HTTP_403IAM denies the selected action, identity, or region.NoGrant only the missing SES action under the intended conditions.
AWS_SES_HTTP_404Referenced template no longer exists.NoReconcile the exact template name before creating or stopping.
AWS_SES_HTTP_429 / 500 / 503Throttle or transient provider pressure.Reads retry; sends/writes report ambiguityInspect provider events and exact resource state before any replay.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Reads retry; sends/writes report ambiguityTreat delivery or mutation acceptance as unknown until reconciled.
EXECUTION_ERRORUnexpected bounded runtime failure.No automatic replayPreserve the operation and request evidence for investigation.

Provider exception text is never copied into workflow output, preventing AWS credentials, recipient data, email content, or unbounded provider payloads from leaking through error handling.

Example

Send a reviewed template after an order reaches the approved fulfillment state:

{
"operation": "send_templated_email",
"region": "us-west-2",
"source": "billing@example.com",
"toAddresses": ["buyer@example.com"],
"replyToAddresses": ["support@example.com"],
"templateName": "OrderReady",
"templateData": {
"orderNumber": "A-1042",
"downloadCount": 3
},
"configurationSetName": "transactional"
}

Expected result shape:

{
"status": "success",
"operation": "send_templated_email",
"attempts": 1,
"resultType": "message",
"data": {
"messageId": "provider-message-id",
"recipientCount": 1,
"templateName": "OrderReady"
},
"requestId": "aws-request-reference"
}

The receipt means SES accepted the submission; it does not prove inbox delivery. Correlate the message with SES event publishing, bounce, complaint, and delivery telemetry outside this connector.

Notes

  • Pagination: list_templates and list_identities return one page unless returnAll=true. The connector follows opaque tokens only with unchanged filters and stops at limit.
  • Rate limits: SES quotas vary by account, production/sandbox state, region, and action. Read calls use at most three attempts with short bounded backoff. Sends and template mutations never retry automatically.
  • API limits: the module caps list output at 1,000 items, combined recipients at 50, template data at 100 keys/100,000 JSON bytes, each body at five million characters, and message/template content at 9 MiB.
  • Idempotency: reads are replay-safe. send_email, send_templated_email, and all template mutations can have side effects and are single-attempt.
  • Ambiguous sends: if transport fails after SES accepts a message, use SES event telemetry, workflow correlation data, and the provider request/message identifiers before deciding whether to replay. Never assume a timeout means no delivery.
  • Template rendering: SES can accept a templated message and later emit a rendering failure. Configure event publishing and monitor rendering-failure events for delivery-critical workflows.
  • Sandbox behavior: SES sandbox accounts can send only from and to verified identities and have reduced quotas. Production access is an account/region control outside the module.
  • Suppression and reputation: account/global suppression, hard bounces, complaints, recipient-provider rejection, and reputation controls can prevent delivery after acceptance.
  • Destructive behavior: delete_template permanently removes the named template and requires confirmDelete=true. The connector never deletes identities or configuration sets.
  • Security: recipients and template content may contain personal or confidential data. Keep outputs within ACL-scoped workflows and do not log whole template reads.
  • Deferred operations: raw MIME, attachments, bulk sends, custom verification email templates, identity verification/deletion, suppression-list management, sending-authorization ARNs, configuration-set lifecycle, SMTP credentials, and event-destination configuration are not implemented.
  • Provider verification boundary: deterministic tests cover validation, recipient deduplication, bounded pagination, template operations, flat data, retry boundaries, deletion confirmation, credential/provider-error redaction, registration, and metadata. Live SES behavior remains unverified until an authorized SES account, verified test identities, and reviewed non-production recipients are supplied.
  • Functional reference: n8n's AWS SES node exposes direct/template sends plus template lifecycle and custom-verification workflows. ValkyrAI covers the high-value direct/template and discovery surface with stronger account, scope, replay, output, and deletion controls.
  • Runtime boundary: merged source and published documentation do not update the deployed Workflow Studio catalog until a ValkyrAI backend release exposes AwsSesModule through /v1/modules/metadata.