Skip to main content

AWS Lambda ExecModule

Overview

AwsLambdaModule connects ValkyrAI workflows to Amazon Lambda through the bundled AWS SDK v2 client. It covers n8n's high-value Lambda invocation behavior and adds bounded function and alias discovery, verified IntegrationAccount credentials, annotation-backed Workflow Studio discovery, fixed AWS routing, and explicit retry boundaries.

The connector implements five operations:

  • functions: list_functions, get_function
  • aliases: list_aliases, get_alias
  • execution: invoke with request_response, event, or dry_run

The legacy AwsExecModule is not a replacement for this connector: it has no input-driven execution path and is not a discoverable production integration. AwsLambdaModule is the typed, governed workflow surface.

Usage

  1. Create a dedicated AWS IAM principal whose policy is restricted to the required functions and Lambda actions.
  2. Store its access key ID and secret access key in an AWS IntegrationAccount, verify the account, and keep it in READY status.
  3. Add AwsLambdaModule to a workflow and bind the account through ExecModuleConfig.authConfig.integrationAccount.
  4. Set operation, region, and the operation-specific function, alias, qualifier, payload, or list fields.
  5. Put a caller correlation ID in the function payload when the function can produce side effects. Preserve returned AWS request IDs before reconciling an ambiguous invocation.

Never place AWS credentials in mapped input, logs, examples, or function payloads. Credential-like input fields are rejected before provider access.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNonelist_functions, get_function, list_aliases, get_alias, or invoke.
regionstringEvery executionNoneAWS region syntax such as us-west-2; custom endpoints are not accepted.
functionNamestringAll except list_functionsNoneFunction name or full Lambda function ARN, at most 170 characters.
qualifierstringOptional get_function or invokeNonePublished version, $LATEST, or alias, at most 128 characters.
aliasNamestringget_aliasNoneAlias name, at most 128 characters.
payloadobject or JSON stringOptional invoke{}Valid JSON; at most 6 MiB synchronously/dry-run or 1 MiB asynchronously.
invocationTypestringinvokerequest_responserequest_response, event, or dry_run.
includeLogTailbooleanOptional synchronous invokefalseAllowed only for request_response; AWS returns at most the service-defined tail.
markerstringOptional list resume pointNoneOpaque AWS marker, at most 4,096 characters.
limitintegerList operations501–10,000 returned records; each AWS request asks for at most 50.
returnAllbooleanList operationsfalseFollow AWS markers until exhaustion or limit.

Outputs

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

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation.
attemptsintegerAlwaysProvider calls, including safe-read retries and list pages.
dataobjectGet or invocation successNormalized function, alias, or invocation receipt.
itemsarrayList successBounded function or alias records.
countintegerList successNumber of returned records.
hasMorebooleanList successWhether another AWS page exists.
nextMarkerstringAnother page existsOpaque marker for a later execution.
functionErrorstringLambda reports oneAWS Handled or Unhandled function-error classification.
logTailBase64stringRequested and returnedBase64 execution log tail; decode only in an authorized destination.
requestIdstringAWS supplies oneBounded request reference for reconciliation and provider support.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

Function configuration output deliberately omits the code download location because AWS returns it as a temporary signed URL. Invocation output parses valid JSON into data.payload; a non-JSON response is returned as a bounded base64 envelope.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

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

Grant only the actions used by the workflow:

  • lambda:ListFunctions for list_functions
  • lambda:GetFunction for get_function
  • lambda:ListAliases for list_aliases
  • lambda:GetAlias for get_alias
  • lambda:InvokeFunction for every invocation type

Restrict lambda:InvokeFunction resources to approved function and qualifier ARNs. The current module supports a long-lived access-key pair. Temporary session credentials, role assumption, cross-account role chaining, custom endpoints, and caller-supplied credentials are deferred.

Configuration

The awsAccount relationship is the only credential configuration. Operation, region, function details, and payload fields belong in module parameters or mapped input; read retries use the normalized retry policy.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-lambda-production"
},
"retryPolicy": {
"maxAttempts": 3
},
"payloadConfig": {
"parameters": "{\"operation\":\"invoke\",\"region\":\"us-west-2\",\"functionName\":\"customer-enrichment\",\"qualifier\":\"production\",\"invocationType\":\"request_response\"}"
}
}

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

Operations

OperationProvider behaviorSide effect and retry behavior
list_functionsLists function configurations with opaque marker pagination.Read-only; transient failures retry within the configured bound.
get_functionGets one function/version configuration without exposing its signed code URL.Read-only; transient failures retry.
list_aliasesLists aliases for one function with marker pagination.Read-only; transient failures retry.
get_aliasGets one named alias and routed function version.Read-only; transient failures retry.
invoke / request_responseExecutes once, waits for results, and returns bounded normalized output.Can produce side effects; exactly one provider attempt.
invoke / eventQueues one asynchronous event and continues after AWS accepts it.Can produce side effects; exactly one attempt; payload limit is 1 MiB.
invoke / dry_runValidates parameters and permission without executing the function.Exactly one provider attempt; no function execution.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing/invalid region, function, alias, qualifier, JSON, list bound, or invocation option.NoCorrect the named input; no unsafe 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_LAMBDA_HTTP_400Invalid provider request, payload, qualifier, or function state.NoValidate the current function configuration and request.
AWS_LAMBDA_HTTP_403IAM denies discovery or invocation.NoGrant only the missing action on the intended function ARN.
AWS_LAMBDA_HTTP_404Function, version, or alias is absent or invisible.NoVerify region and immutable function/qualifier.
AWS_LAMBDA_HTTP_409Function state prevents invocation or update-related access.NoRead current function state and wait for the provider transition.
AWS_LAMBDA_HTTP_429 / 503Concurrency throttle or transient AWS pressure.Yes for readsDiscovery reads can retry; reconcile before replaying an invocation.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Yes for readsVerify connectivity. Treat an invocation outcome as ambiguous.
EXECUTION_ERRORUnexpected bounded runtime failure.No automatic invocation retryPreserve identifiers/request ID and reconcile external effects.

AWS provider exception text is not copied into output, preventing credential echoes and unbounded error payloads. A functionError means Lambda accepted and executed the request but the function reported failure; inspect the authorized function observability surface using the request ID.

Example

Invoke an approved production alias synchronously:

{
"operation": "invoke",
"region": "us-west-2",
"functionName": "customer-enrichment",
"qualifier": "production",
"invocationType": "request_response",
"includeLogTail": false,
"payload": {
"customerId": "cust-123",
"correlationId": "workflow-2026-09-04-cust-123"
}
}

Expected result shape:

{
"status": "success",
"operation": "invoke",
"attempts": 1,
"requestId": "aws-request-reference",
"data": {
"functionName": "customer-enrichment",
"invocationType": "request_response",
"statusCode": 200,
"executedVersion": "42",
"payload": {
"enriched": true
}
}
}

Notes

  • Pagination: both list operations preserve AWS markers as opaque values. returnAll=true follows only fixed Lambda endpoints and stops at limit or 10,000 records.
  • Rate limits: HTTP 408, 429, 500, 502, 503, and 504 plus network failures can retry only for discovery reads, bounded by RetryPolicy.maxAttempts from 1 through 5. AWS SDK retries are disabled so module accounting and single-attempt invocation are deterministic.
  • API limits: synchronous and dry-run payloads are bounded at 6 MiB; asynchronous event payloads at 1 MiB; synchronous response bodies at 6 MiB. Streaming responses, response streaming, function creation/update/delete, layer management, concurrency mutation, event-source mappings, and destinations are deferred.
  • Idempotency: function invocation has no universal provider idempotency key. Put a domain correlation ID in the payload and implement deduplication in the target function when retries are possible.
  • Destructive behavior: this connector does not create, update, or delete Lambda resources, but invoked code can have arbitrary external effects. Every invocation is one provider attempt and is classified as external code execution.
  • Data handling: invocation payloads and results are confidential and sent only to the Lambda endpoint selected by the validated AWS region. Request/response bodies are never logged by the module.
  • Provider verification boundary: deterministic tests cover validation, account isolation, SDK request mapping, pagination, retry boundaries, response normalization, redaction, and discovery. Live AWS behavior remains unverified until an authorized Lambda credential and reviewed test function are supplied.
  • Functional reference: n8n's current AWS Lambda node invokes a selected function with a qualifier, JSON payload, and synchronous/asynchronous mode. ValkyrAI adds bounded function/alias discovery, dry-run permission checks, fixed routing, verified IntegrationAccount enforcement, safe output normalization, and read-only retry boundaries.
  • Runtime boundary: merged source and published documentation do not update the deployed Workflow Studio catalog until a ValkyrAI backend release exposes AwsLambdaModule through /v1/modules/metadata.