Skip to main content

AWS_Lambda

This tool invokes an AWS Lambda function with a provided payload.

Use this tool when you need to trigger serverless logic, run background jobs, or call a remote function hosted in AWS Lambda.

info

Note:- With it you can also extend functionality by integrating your own custom functions. These functions can act as standalone tools, deployed via AWS Lambda, and can be invoked by passing the required parameters.

Configuration

Assign the tool to an agent and provide the function_name. You can pass AWS credentials via the tool config or environment variables.

tools:
tool_assigned:
- name: "AWS_Lambda"
config:
function_name: "my-lambda-fn"
AWS_REGION: "us-east-1"
payload: |-
payload:
API_key: "Tav2348fsd-34twdsf"

Required fields

  • function_name (required)
  • AWS credentials: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION (defaults to us-east-1).
  • Optional payload

Returns

The tool returns the Lambda function's response payload as a string.

Errors

Errors from invocation are raised with details about why the call failed.

Usage

While adding data in agent node you can do it in two way

  1. Directly adding values
  2. From keyvault

1) Direct way

You can nornmally provide value in agent node For e.g:- In payload

payload:     
key: "value"

In above payload (keyword) should be as it is and below that start adding your key values after 2 space from newline and value should be enclosed in quotes "

Same will follow for body and params

2) Using keyvault

Instead of providing direct values you can pass the values by using placeholders defined as key in your keyvault
For e.g:-
Same in payload if i you have to pass token you can do that using keyvault. Assuming you had added token in you keyvault as AccessToken as key name

Now in agent node in the header part of tool config you can add like this

payload:     
mytoken: "${AccessToken}"

Note:- Placeholder should be enclosed in double quote " and starts with dollar symbold $ followed by curly braces {}

YAML usage

Assigning the Lambda tool to an agent and invoking it with a payload follows the same pattern used throughout the Agentic Network YAML.

tools:
tool_assigned:
- name: "AWS_Lambda"
config:
function_name: "my-lambda-fn"
AWS_REGION: "us-east-1"

# Invocation payload
payload: |-
payload:
user_id: "123"
action: "sync"