AutomationFlowsAI & RAG › Agentcore — Inline Function Round-trip

Agentcore — Inline Function Round-trip

AgentCore — Inline Function Round-Trip. Uses @aws/n8n-nodes-agentcore. Event-driven trigger; 4 nodes.

Event trigger★★★★☆ complexity4 nodes@Aws/N8N Nodes Agentcore
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "AgentCore \u2014 Inline Function Round-Trip",
  "nodes": [
    {
      "parameters": {},
      "id": "1",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "agentName": "weather_agent",
        "modelProvider": "bedrock",
        "modelId": "global.anthropic.claude-sonnet-4-6",
        "systemPrompt": "You help users with weather. Call get_weather when you need current conditions.",
        "prompt": "What should I wear in Seattle today?",
        "tools": {
          "tool": [
            {
              "type": "inline_function",
              "name": "get_weather",
              "description": "Get the current weather for a city.",
              "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": { \"city\": { \"type\": \"string\" } },\n  \"required\": [\"city\"]\n}"
            }
          ]
        },
        "sessionId": "={{ $execution.id }}-weather"
      },
      "id": "2",
      "name": "Call 1 - Agent Requests Tool",
      "type": "@aws/n8n-nodes-agentcore.agentCoreHarness",
      "typeVersion": 1,
      "position": [
        480,
        300
      ],
      "credentials": {
        "agentCoreApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// In a real workflow you'd call a weather API here using\n// $json.toolUses[0].input.city. We hard-code a result for the demo.\nreturn [{ json: { ...$json, computedWeather: '52F, light rain' } }];"
      },
      "id": "3",
      "name": "Compute Tool Result",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "agentName": "weather_agent",
        "modelProvider": "bedrock",
        "modelId": "global.anthropic.claude-sonnet-4-6",
        "prompt": "",
        "sessionId": "={{ $execution.id }}-weather",
        "toolResults": {
          "result": [
            {
              "toolUseId": "={{ $json.toolUses[0].toolUseId }}",
              "name": "={{ $json.toolUses[0].name }}",
              "input": "={{ $json.toolUses[0].input }}",
              "content": "={{ $json.computedWeather }}",
              "status": "success"
            }
          ]
        }
      },
      "id": "4",
      "name": "Call 2 - Send Tool Result",
      "type": "@aws/n8n-nodes-agentcore.agentCoreHarness",
      "typeVersion": 1,
      "position": [
        960,
        300
      ],
      "credentials": {
        "agentCoreApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Call 1 - Agent Requests Tool",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call 1 - Agent Requests Tool": {
      "main": [
        [
          {
            "node": "Compute Tool Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute Tool Result": {
      "main": [
        [
          {
            "node": "Call 2 - Send Tool Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AgentCore — Inline Function Round-Trip. Uses @aws/n8n-nodes-agentcore. Event-driven trigger; 4 nodes.

Source: https://github.com/aws/n8n-nodes-agentcore/blob/d9a11228fa141eda812e555ad649f347051eaa6f/examples/07-inline-function-roundtrip.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

AgentCore — MCP Research Agent. Uses @aws/n8n-nodes-agentcore. Event-driven trigger; 2 nodes.

@Aws/N8N Nodes Agentcore
AI & RAG

AgentCore — Code Interpreter Data Analysis. Uses @aws/n8n-nodes-agentcore. Event-driven trigger; 2 nodes.

@Aws/N8N Nodes Agentcore
AI & RAG

agente. Uses googleTasksTool, telegramTrigger, telegramTool, telegram. Event-driven trigger; 94 nodes.

Google Tasks Tool, Telegram Trigger, Telegram Tool +3
AI & RAG

This is for SaaS founders, agency owners, and Sales Ops managers who use HubSpot but are tired of "toe-stepping." If your BDRs are accidentally emailing your AE’s active deals, or Marketing is blastin

Data Table, HTTP Request
AI & RAG

Inquiry-Agent. Uses @digitalocean/n8n-nodes-digitalocean-gradient-serverless-inference, stopAndError, googleDocs, gmail. Event-driven trigger; 59 nodes.

@Digitalocean/N8N Nodes Digitalocean Gradient Serverless Inference, Stop And Error, Google Docs +4