1. Overview
AWS Lambda is Amazon Web Services’ serverless compute service: you upload code and Lambda runs it at scale without you managing servers. Functions can run in response to events or be invoked directly, and you pay for what you use.
Through GoInsight’s Aws Lambda node, you can plug Lambda into automation workflows. You can:
- Discover functions in a region and inspect basic metadata (name, ARN, runtime, memory, timeout, and more).
- Invoke functions synchronously or asynchronously, pass structured input, and read execution results and status fields.
2. Prerequisites
Before using this node, you need a valid AWS account and IAM credentials that can call the Lambda API in the target region.
Typical permission expectations:
- List Functions: lambda:ListFunctions (and valid credentials for the chosen region).
- Invoke Function: lambda:InvokeFunction on the target function (or resource ARN), plus correct region and identity.
You may need an administrator or someone with IAM access to create access keys, roles, or policies if your account does not already grant these actions.
3. Credentials
For detailed instructions on how to obtain and configure credentials, please refer to our official documentation: Credentials Configuration Guide.
4. Supported Operations
The Aws Lambda node is centered on the Functions resource: you can enumerate functions in a region and invoke a function by name or ARN.
Summary
| Resource | Operation | Description |
|---|---|---|
| Functions | List Functions | Returns a page of Lambda functions in the configured region with core metadata; supports pagination via Marker and NextMarker. Read-only. |
| Functions | Invoke Function | Invokes a Lambda function synchronously (RequestResponse) or asynchronously (Event), with optional JSON payload and version or alias. May execute side effects in your AWS account or downstream systems. |
Operation Details
List Functions
Returns a list of AWS Lambda functions in the selected region, including key metadata such as name, ARN, runtime, handler, code size, description, timeout, memory, last modified time, and version. Use this to discover function names and ARNs before invoking, or for inventory-style checks. This operation does not return function code, environment variables, layers, or invocation history. Pagination: at most 50 functions per request; use Marker with NextMarker from the previous response to fetch additional pages.
Options:
- MaxItems: Maximum number of functions to return in one request (1–50). Default is 50.
- Marker: Pagination token from a previous response. Leave empty for the first request; use the value from NextMarker to fetch the next page.
- SessionToken: Session token for temporary AWS credentials (for example from STS AssumeRole). Leave empty when using long-term IAM access keys.
Output:
- ListComplete (bool): Whether the listing completed successfully.
- FunctionsCount (number): Number of functions returned in this response.
- FunctionsData (object-array): Array of function objects with fields such as FunctionName, FunctionArn, Runtime, Handler, CodeSize, Description, Timeout, MemorySize, LastModified, and Version.
- NextMarker (string): Token for the next page; empty if there are no more results.
- HasMore (bool): Whether more functions are available (typically when NextMarker is non-empty).
- Summary (string): Short human-readable summary of the result (count and pagination status).
- OriginalStatusCode (number): Raw HTTP status from the AWS API; 0 if the request did not reach AWS (for example due to timeout).
- StatusCode (number): Normalized status: 200 for success, -1 for parameter validation errors, 500 for system or network errors (may be retryable).
- ErrorMessage (string): Error description; empty on success.
- Hint (string): Suggested next step when an error occurs; empty on success.
- Retryable (bool): Whether retrying the same request may succeed (transient errors such as throttling or 5xx).
Invoke Function
Invokes an existing Lambda function by name or ARN. Use synchronous invocation to wait for a result, or asynchronous invocation for fire-and-forget execution. Passing a Payload sends a JSON object to your function (structure must match what the function expects). Invoking a function can change external state depending on your function’s logic; it is not guaranteed to be idempotent.
Input Parameters:
- FunctionName: The function name or full ARN of the Lambda function to invoke. Same-account calls often use a short name; cross-account calls typically require a full ARN.
Options:
- Payload: Input object passed to the function as JSON. Shape depends on your function; omit or leave empty if the handler expects no input.
- InvocationType: RequestResponse (default) waits for completion and returns a body in Result; Event invokes asynchronously and Result is empty.
- Qualifier: Version or alias to invoke (for example $LATEST, a numeric version, or an alias such as prod).
- SessionToken: Session token for temporary credentials (for example STS). Leave empty for long-term access keys.
Output:
- InvokeSuccess (bool): Whether the invocation completed without a function-level error flag (see FunctionError).
- Result (string): Raw response body from Lambda (often JSON text). For Event invocations, typically empty.
- ExecutedVersion (string): Version of the function that ran.
- FunctionError (string): Function error indicator from Lambda (for example handled vs unhandled); empty when the invocation itself succeeded from Lambda’s perspective.
- OriginalStatusCode (number): Raw HTTP status from the AWS API; 0 if the request was not sent.
- StatusCode (number): System status: 200 when the client path is healthy (check ErrorMessage for API-level issues), 500 for network or runtime failures, -1 for parameter validation before send.
- ErrorMessage (string): Error description when something failed; empty on full success.
- Hint (string): Suggested next step when an error occurs; empty on success.
- Retryable (bool): Whether retrying the same request may succeed for transient failures.
5. Example Usage
This walkthrough builds a small workflow that invokes a Lambda function and inspects the result—one of the most common Aws Lambda node use cases.
Workflow overview: Start → Aws Lambda (Invoke Function) → Answer.
Step-by-step guide:
- Add the tool node
- On the workflow canvas, add a new node (for example via “+”).
- Open the Tools tab and select Aws Lambda.
- Choose the Invoke Function action so the corresponding node appears on the canvas.
- Configure the node
- Select the Invoke Function node to open its panel.
- Credentials: Pick your saved AWS credential (the same credential supplies region and keys; ensure the region matches where the function exists).
- FunctionName: Enter your function’s name (for example my-worker) or its ARN if you invoke across accounts or need an explicit resource.
- Payload: If the handler expects JSON, provide an object that matches its contract (for example keys the function reads from event).
- InvocationType: Keep RequestResponse to wait for the function output in Result; use Event only when you do not need a return payload.
- Qualifier: Use $LATEST or pin a version or alias for repeatable behavior.
- Run and verify
- Resolve any validation hints on the canvas, then run a test execution.
- Open execution logs and confirm InvokeSuccess, Result, and FunctionError as expected. If ErrorMessage or Hint is set, follow Hint (permissions, region, function name, or payload shape).
What you should see: After a successful synchronous run, Result should contain your function’s returned payload as text (often JSON), and ExecutedVersion shows which version ran.
6. FAQs
Q: I see 401/403 or “access denied” when listing or invoking. What should I check?
A: Usually IAM or credential configuration:
- Confirm the IAM user or role has lambda:ListFunctions and/or lambda:InvokeFunction as needed.
- Ensure the AWS credential in GoInsight is correct, not expired, and uses the intended region.
- For temporary credentials, set SessionToken when required.
Q: Why is Result empty even though the invocation seemed to succeed?
A: Common reasons:
- InvocationType is Event (asynchronous invocations do not return a function payload in Result).
- The function returned no body or the client timed out before reading the response.
Q: Payload validation or parse errors
A: Supply a JSON object that matches what your handler expects. If the function still fails, inspect FunctionError, ErrorMessage, and CloudWatch Logs for the function in the AWS console.
Q: Listing returns no functions but I know they exist
A: Lambda is regional—verify the credential’s Region matches where the functions were created. Also confirm MaxItems and pagination: use NextMarker / Marker until HasMore is false.
Q: What do StatusCode, ErrorMessage, Hint, and Retryable mean?
A: They summarize outcome and whether to retry:
- Retryable true often indicates throttling or transient AWS/network errors.
- Hint gives a concrete next step; ErrorMessage carries the detailed message.
Leave a Reply.