{"id":1046,"date":"2026-11-16T00:24:07","date_gmt":"2026-11-15T18:54:07","guid":{"rendered":"https:\/\/techgyan360.com\/blog\/?p=1046"},"modified":"2026-11-16T01:04:03","modified_gmt":"2026-11-15T19:34:03","slug":"amazon-connect-lambda-integration","status":"publish","type":"post","link":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/","title":{"rendered":"Amazon Connect Lambda Integration: Step-by-Step Guide with Code Examples (2026)"},"content":{"rendered":"<blockquote><p><strong>Quick answer:<\/strong> Amazon Connect calls AWS Lambda from a contact flow using the <strong>Invoke AWS Lambda function<\/strong> block. Connect sends your function an event holding the contact&#8217;s details (caller number, channel, attributes) plus any parameters you set. Your function returns a small set of key\/value pairs, and the flow reads them as <code>$.External.keyName<\/code> to make routing decisions, play personalised prompts or save contact attributes. In synchronous mode the call must finish within <strong>8 seconds<\/strong>, and the response must be under <strong>64 KB<\/strong>.<\/p><\/blockquote>\n<p>Lambda is what turns a basic IVR into a smart one. Without it, a contact flow only knows what Amazon Connect knows. With it, the flow can look up the caller in your CRM, check an order, test for a holiday or decide that this caller is a VIP who skips the queue. In this guide you&#8217;ll build a working integration step by step, with code in Python and Node.js, three real-world examples and the mistakes that break most first attempts.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#How_Amazon_Connect_Lambda_integration_works\" >How Amazon Connect Lambda integration works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Step_1_Create_the_Lambda_function\" >Step 1: Create the Lambda function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Step_2_Add_the_function_to_your_Connect_instance\" >Step 2: Add the function to your Connect instance<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Step_3_Call_Lambda_from_a_contact_flow\" >Step 3: Call Lambda from a contact flow<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#The_input_event_Connect_sends\" >The input event Connect sends<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Response_format_rules_STRING_MAP_vs_JSON\" >Response format rules (STRING_MAP vs JSON)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Using_the_results_in_your_flow\" >Using the results in your flow<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Three_real-world_examples\" >Three real-world examples<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Example_1_customer_lookup_in_DynamoDB_with_VIP_routing\" >Example 1: customer lookup in DynamoDB with VIP routing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Example_2_order_status_from_an_external_REST_API\" >Example 2: order status from an external REST API<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Example_3_business_hours_with_a_holiday_list\" >Example 3: business hours with a holiday list<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Error_handling_timeouts_and_retries\" >Error handling, timeouts and retries<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Testing_and_CloudWatch_logs\" >Testing and CloudWatch logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Security_and_best_practices\" >Security and best practices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Frequently_asked_questions\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#What_is_the_maximum_Lambda_timeout_in_Amazon_Connect\" >What is the maximum Lambda timeout in Amazon Connect?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Why_does_my_Lambda_work_in_testing_but_go_down_the_Error_branch_in_the_flow\" >Why does my Lambda work in testing but go down the Error branch in the flow?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#How_do_I_pass_data_from_the_flow_into_Lambda\" >How do I pass data from the flow into Lambda?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Can_Lambda_return_nested_JSON_to_Amazon_Connect\" >Can Lambda return nested JSON to Amazon Connect?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Can_one_Lambda_function_serve_several_flows\" >Can one Lambda function serve several flows?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Does_Amazon_Connect_Lambda_work_for_chat_tasks_and_email\" >Does Amazon Connect Lambda work for chat, tasks and email?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#Next_steps\" >Next steps<\/a><\/li><\/ul><\/nav><\/div>\n<h2 id=\"how-it-works\"><span class=\"ez-toc-section\" id=\"How_Amazon_Connect_Lambda_integration_works\"><\/span>How Amazon Connect Lambda integration works<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The whole integration is a round trip of four steps:<\/p>\n<ol>\n<li><strong>The contact reaches the block.<\/strong> A caller (or a chat, task or email contact) arrives at the <em>Invoke AWS Lambda function<\/em> block in your flow.<\/li>\n<li><strong>Connect sends an event.<\/strong> Connect invokes your function with a JSON event containing <code>Details.ContactData<\/code> (always sent) and <code>Details.Parameters<\/code> (the values you configure on the block).<\/li>\n<li><strong>Lambda does the work.<\/strong> Your code reads the event, calls whatever it needs (DynamoDB, an API, Salesforce, a database) and returns key\/value pairs.<\/li>\n<li><strong>The flow uses the result.<\/strong> The returned keys become available as <code>$.External.key<\/code>. The flow can branch on them with a <em>Check contact attributes<\/em> block, speak them in a prompt, or store them with <em>Set contact attributes<\/em>.<\/li>\n<\/ol>\n<p>The block works on all four channels (voice, chat, task and email) and in most flow types: inbound, customer queue, customer hold, customer whisper, outbound whisper, agent hold, agent whisper, transfer to agent and transfer to queue. If you&#8217;re new to flows, read our <a href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-contact-flows-guide\/\">Amazon Connect contact flows guide<\/a> first.<\/p>\n<h2 id=\"create\"><span class=\"ez-toc-section\" id=\"Step_1_Create_the_Lambda_function\"><\/span>Step 1: Create the Lambda function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Create the function in the <strong>same AWS Region as your Connect instance<\/strong>. That keeps setup simple: the Connect console only lists functions from its own Region, and it grants invoke permission automatically when you add them.<\/p>\n<ol>\n<li>Open the AWS Lambda console and choose <strong>Create function<\/strong> \u2192 <strong>Author from scratch<\/strong>.<\/li>\n<li>Name it, for example <code>connect-customer-lookup<\/code>.<\/li>\n<li>Pick a runtime: <strong>Python 3.12<\/strong> or <strong>Node.js 20.x<\/strong> are good choices.<\/li>\n<li>Keep the default execution role for now (you&#8217;ll add DynamoDB permissions later if you need them).<\/li>\n<li>Under <strong>Configuration \u2192 General configuration<\/strong>, set the function timeout to about <strong>5 seconds<\/strong>. Connect won&#8217;t wait longer than 8 seconds anyway, so a long Lambda timeout only wastes money.<\/li>\n<\/ol>\n<p>Here&#8217;s a minimal function that greets the caller using their phone number. Python first:<\/p>\n<pre><code class=\"language-python\">def lambda_handler(event, context):\r\n    contact = event[\"Details\"][\"ContactData\"]\r\n    params = event[\"Details\"].get(\"Parameters\", {})\r\n\r\n    phone = contact.get(\"CustomerEndpoint\", {}).get(\"Address\", \"unknown\")\r\n    company = params.get(\"companyName\", \"TechGyan360\")\r\n\r\n    # Every value returned must be a string for STRING_MAP validation\r\n    return {\r\n        \"greeting\": f\"Welcome to {company}\",\r\n        \"callerNumber\": phone,\r\n        \"lookupStatus\": \"OK\"\r\n    }<\/code><\/pre>\n<p>The same function in Node.js (ES module syntax, as used by Node.js 18 and later):<\/p>\n<pre><code class=\"language-javascript\">export const handler = async (event) =&gt; {\r\n  const contact = event.Details.ContactData;\r\n  const params = event.Details.Parameters || {};\r\n\r\n  const phone = contact.CustomerEndpoint?.Address ?? \"unknown\";\r\n  const company = params.companyName ?? \"TechGyan360\";\r\n\r\n  return {\r\n    greeting: `Welcome to ${company}`,\r\n    callerNumber: phone,\r\n    lookupStatus: \"OK\"\r\n  };\r\n};<\/code><\/pre>\n<h2 id=\"add\"><span class=\"ez-toc-section\" id=\"Step_2_Add_the_function_to_your_Connect_instance\"><\/span>Step 2: Add the function to your Connect instance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A flow can&#8217;t call a function until the instance knows about it.<\/p>\n<ol>\n<li>Open the Amazon Connect console and choose your <strong>instance alias<\/strong>.<\/li>\n<li>In the navigation pane, choose <strong>Flows<\/strong>.<\/li>\n<li>In the <strong>AWS Lambda<\/strong> section, pick your function from the <strong>Function<\/strong> drop-down and choose <strong>Add Lambda Function<\/strong>.<\/li>\n<li>Check that its ARN now appears under <strong>Lambda Functions<\/strong>.<\/li>\n<\/ol>\n<p>Adding the function this way automatically gives Connect permission to invoke it.<\/p>\n<p><strong>Function in another Region or account?<\/strong> Paste its ARN into the flow block directly, then grant Connect permission yourself with a resource policy:<\/p>\n<pre><code class=\"language-bash\">aws lambda add-permission \\\r\n  --function-name arn:aws:lambda:us-east-1:111122223333:function:connect-customer-lookup \\\r\n  --statement-id connect-invoke \\\r\n  --action lambda:InvokeFunction \\\r\n  --principal connect.amazonaws.com \\\r\n  --source-account 444455556666 \\\r\n  --source-arn arn:aws:connect:us-east-1:444455556666:instance\/your-instance-id<\/code><\/pre>\n<p>Always set <code>--source-arn<\/code> to your instance ARN. Without it, any Connect instance could invoke your function.<\/p>\n<h2 id=\"flow\"><span class=\"ez-toc-section\" id=\"Step_3_Call_Lambda_from_a_contact_flow\"><\/span>Step 3: Call Lambda from a contact flow<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Open your flow in the flow designer and drag in the <strong>Invoke AWS Lambda function<\/strong> block (in the <em>Integrate<\/em> group).<\/li>\n<li>Set <strong>Select an action<\/strong> to <strong>Invoke Lambda<\/strong>, then choose your function.<\/li>\n<li>Under <strong>Function input parameters<\/strong>, add any values the function needs, for example key <code>companyName<\/code>, set manually or from an attribute. These arrive in <code>Details.Parameters<\/code>.<\/li>\n<li>Choose the <strong>Execution mode<\/strong>:\n<ul>\n<li><strong>Synchronous:<\/strong> the contact waits until Lambda finishes. Timeout up to <strong>8 seconds<\/strong>. The block has <em>Success<\/em>, <em>Error<\/em> and <em>Timeout<\/em> branches.<\/li>\n<li><strong>Asynchronous:<\/strong> the contact moves on straight away. Timeout up to <strong>60 seconds<\/strong>. Use a <em>Wait<\/em> block to wait for the result, then a second Lambda block with the action <strong>Load Lambda result<\/strong> (it uses <code>$.LambdaInvocation.InvocationId<\/code> to fetch the most recent asynchronous result).<\/li>\n<\/ul>\n<\/li>\n<li>Choose <strong>Response validation<\/strong>: <code>STRING_MAP<\/code> or <code>JSON<\/code> (explained below).<\/li>\n<li>Connect the <em>Success<\/em> branch to the rest of your flow and the <em>Error<\/em> (and <em>Timeout<\/em>) branches to a safe fallback, such as a prompt plus transfer to a general queue.<\/li>\n<li>Save and <strong>Publish<\/strong> the flow.<\/li>\n<\/ol>\n<div class=\"tip\"><strong>Sync or async?<\/strong> Use synchronous for quick lookups (under a second or two), which covers most cases. Use asynchronous when the work is slow, such as calling a sluggish legacy API, and play hold music or a message while you wait so the caller doesn&#8217;t hear silence.<\/div>\n<h2 id=\"event\"><span class=\"ez-toc-section\" id=\"The_input_event_Connect_sends\"><\/span>The input event Connect sends<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Every invocation gets the same structure. Here&#8217;s an abbreviated example with the fields you&#8217;ll use most:<\/p>\n<pre><code class=\"language-json\">{\r\n  \"Details\": {\r\n    \"ContactData\": {\r\n      \"Attributes\": { \"language\": \"en\" },\r\n      \"Channel\": \"VOICE\",\r\n      \"ContactId\": \"4a573372-1f28-4e26-b97b-XXXXXXXXXXX\",\r\n      \"CustomerEndpoint\": { \"Address\": \"+14155550123\", \"Type\": \"TELEPHONE_NUMBER\" },\r\n      \"InitialContactId\": \"4a573372-1f28-4e26-b97b-XXXXXXXXXXX\",\r\n      \"InitiationMethod\": \"INBOUND\",\r\n      \"InstanceARN\": \"arn:aws:connect:us-east-1:111122223333:instance\/...\",\r\n      \"LanguageCode\": \"en-US\",\r\n      \"Queue\": { \"Name\": \"Support\", \"ARN\": \"arn:aws:connect:...\" },\r\n      \"SystemEndpoint\": { \"Address\": \"+18005550100\", \"Type\": \"TELEPHONE_NUMBER\" }\r\n    },\r\n    \"Parameters\": { \"companyName\": \"TechGyan360\" }\r\n  },\r\n  \"Name\": \"ContactFlowEvent\"\r\n}<\/code><\/pre>\n<p>The rules that matter:<\/p>\n<ul>\n<li><strong>Block parameters<\/strong> are in <code>event.Details.Parameters<\/code>.<\/li>\n<li><strong>Contact attributes<\/strong> set earlier in the flow are in <code>event.Details.ContactData.Attributes<\/code>.<\/li>\n<li><strong>The caller&#8217;s number<\/strong> is <code>event.Details.ContactData.CustomerEndpoint.Address<\/code> in E.164 format (for example <code>+14155550123<\/code>).<\/li>\n<li><strong>The number they dialled<\/strong> is <code>SystemEndpoint.Address<\/code>. It&#8217;s handy when one function serves several brands or DIDs.<\/li>\n<li>Fields can be missing or null depending on the channel (a chat has no phone number), so read them defensively with <code>.get()<\/code> in Python or <code>?.<\/code> in JavaScript.<\/li>\n<\/ul>\n<h2 id=\"response\"><span class=\"ez-toc-section\" id=\"Response_format_rules_STRING_MAP_vs_JSON\"><\/span>Response format rules (STRING_MAP vs JSON)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This is where most integrations break. You choose the format with the block&#8217;s <strong>Response validation<\/strong> setting.<\/p>\n<table>\n<thead>\n<tr>\n<th><\/th>\n<th>STRING_MAP<\/th>\n<th>JSON<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Shape<\/td>\n<td>Flat key\/value pairs only<\/td>\n<td>Any valid JSON, including nested objects<\/td>\n<\/tr>\n<tr>\n<td>Value types<\/td>\n<td>Strings only<\/td>\n<td>Strings, numbers, booleans, objects<\/td>\n<\/tr>\n<tr>\n<td>Characters<\/td>\n<td>Values limited to letters, numbers, dashes and underscores<\/td>\n<td>No such restriction<\/td>\n<\/tr>\n<tr>\n<td>Reference in flow<\/td>\n<td><code>$.External.AccountId<\/code><\/td>\n<td><code>$.External.Name.First<\/code> (dot path into nested data)<\/td>\n<\/tr>\n<tr>\n<td>Best for<\/td>\n<td>Simple flags and IDs<\/td>\n<td>Richer data, text with spaces or punctuation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Some limits apply to both:<\/p>\n<ul>\n<li><strong>Size:<\/strong> the response must be under <strong>64 KB<\/strong> (UTF-8).<\/li>\n<li><strong>Arrays:<\/strong> flows can&#8217;t reference array items. If you return <code>\"OrderIds\": [\"x1\",\"y2\"]<\/code>, the flow can&#8217;t read <code>OrderIds[0]<\/code>. Return <code>\"latestOrderId\": \"x1\"<\/code> instead, or pass the array on to another Lambda.<\/li>\n<li><strong>No nulls or exceptions:<\/strong> if the response can&#8217;t be parsed, the contact goes down the <em>Error<\/em> branch.<\/li>\n<\/ul>\n<div class=\"tip\"><strong>Common trap:<\/strong> with STRING_MAP, returning a number (<code>\"balance\": 120<\/code>) or a value with spaces or symbols (<code>\"$1,000.50\"<\/code>) can fail validation. Either convert values to simple strings (<code>str(balance)<\/code>) or switch the block to JSON validation. That&#8217;s the safer default for anything a customer will hear.<\/div>\n<h2 id=\"use\"><span class=\"ez-toc-section\" id=\"Using_the_results_in_your_flow\"><\/span>Using the results in your flow<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There are two ways to use what Lambda returns.<\/p>\n<p><strong>Option 1: reference it directly with <code>$.External<\/code>.<\/strong> In a Play prompt you can write text such as <em>&#8220;Your order status is $.External.orderStatus&#8221;<\/em>. In a <em>Check contact attributes<\/em> block, choose namespace <strong>External<\/strong> and key <code>isVip<\/code> and branch on the value <code>true<\/code>. External values aren&#8217;t stored in the contact record, and they&#8217;re <strong>replaced the next time any Lambda runs<\/strong> in the flow.<\/p>\n<p><strong>Option 2: save them as contact attributes.<\/strong> Add a <em>Set contact attributes<\/em> block straight after the Lambda block: destination type <strong>User defined<\/strong>, key <code>customerTier<\/code>, value from namespace <strong>External<\/strong>, key <code>tier<\/code>. Attributes last for the whole contact, show in the agent&#8217;s Contact Control Panel and appear in contact records, so you can report on them later.<\/p>\n<p><strong>Rule of thumb:<\/strong> anything you need after another Lambda call, or anything an agent or a report should see, belongs in an attribute.<\/p>\n<h2 id=\"examples\"><span class=\"ez-toc-section\" id=\"Three_real-world_examples\"><\/span>Three real-world examples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Example_1_customer_lookup_in_DynamoDB_with_VIP_routing\"><\/span>Example 1: customer lookup in DynamoDB with VIP routing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The caller&#8217;s number is looked up in a DynamoDB table called <code>Customers<\/code>, keyed on <code>phone<\/code>. VIP customers go to a priority queue, and everyone hears their name.<\/p>\n<pre><code class=\"language-python\">import os\r\nimport boto3\r\n\r\ntable = boto3.resource(\"dynamodb\").Table(os.environ.get(\"TABLE_NAME\", \"Customers\"))\r\n\r\ndef lambda_handler(event, context):\r\n    phone = (event[\"Details\"][\"ContactData\"]\r\n             .get(\"CustomerEndpoint\", {}) or {}).get(\"Address\")\r\n    if not phone:\r\n        return {\"found\": \"false\"}\r\n\r\n    try:\r\n        item = table.get_item(Key={\"phone\": phone}).get(\"Item\")\r\n    except Exception as exc:\r\n        print(f\"DynamoDB error for contact \"\r\n              f\"{event['Details']['ContactData'].get('ContactId')}: {exc}\")\r\n        return {\"found\": \"error\"}\r\n\r\n    if not item:\r\n        return {\"found\": \"false\"}\r\n\r\n    return {\r\n        \"found\": \"true\",\r\n        \"firstName\": item.get(\"firstName\", \"\"),\r\n        \"tier\": item.get(\"tier\", \"standard\"),\r\n        \"isVip\": \"true\" if item.get(\"tier\") == \"gold\" else \"false\",\r\n        \"accountId\": item.get(\"accountId\", \"\")\r\n    }<\/code><\/pre>\n<p><strong>The flow:<\/strong> Invoke Lambda (JSON validation) \u2192 Set contact attributes (save <code>tier<\/code> and <code>accountId<\/code>) \u2192 Check contact attributes on <code>$.External.isVip<\/code>. When it&#8217;s <code>true<\/code>: Set working queue to <em>VIP Support<\/em>. Otherwise: <em>General Support<\/em>. Then play the prompt <em>&#8220;Hi $.External.firstName, thanks for calling.&#8221;<\/em> only when <code>found<\/code> is <code>true<\/code>.<\/p>\n<p><strong>Permissions:<\/strong> give the Lambda&#8217;s execution role <code>dynamodb:GetItem<\/code> on that one table, and nothing broader.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_2_order_status_from_an_external_REST_API\"><\/span>Example 2: order status from an external REST API<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The caller enters an order number with <em>Store customer input<\/em>, which you save as the attribute <code>orderNumber<\/code>. Lambda calls your order API and returns a status the flow can read aloud. This Node.js example uses the built-in <code>fetch<\/code> (Node.js 18+), with its own short timeout so that a slow API can&#8217;t hang the call.<\/p>\n<pre><code class=\"language-javascript\">const API_BASE = process.env.ORDER_API_URL;   \/\/ e.g. https:\/\/api.example.com\r\nconst API_KEY  = process.env.ORDER_API_KEY;   \/\/ better: load from Secrets Manager\r\n\r\nexport const handler = async (event) =&gt; {\r\n  const orderNumber = event.Details.ContactData.Attributes?.orderNumber;\r\n  if (!orderNumber) return { orderFound: \"false\" };\r\n\r\n  const controller = new AbortController();\r\n  const timer = setTimeout(() =&gt; controller.abort(), 3000); \/\/ stay well under 8s\r\n\r\n  try {\r\n    const res = await fetch(`${API_BASE}\/orders\/${encodeURIComponent(orderNumber)}`, {\r\n      headers: { Authorization: `Bearer ${API_KEY}` },\r\n      signal: controller.signal\r\n    });\r\n    if (res.status === 404) return { orderFound: \"false\" };\r\n    if (!res.ok) throw new Error(`API returned ${res.status}`);\r\n\r\n    const order = await res.json();\r\n    return {\r\n      orderFound: \"true\",\r\n      orderStatus: order.status,          \/\/ e.g. \"shipped\"\r\n      deliveryDate: order.deliveryDate    \/\/ e.g. \"18 November\"\r\n    };\r\n  } catch (err) {\r\n    console.error(\"Order lookup failed\", event.Details.ContactData.ContactId, err.message);\r\n    return { orderFound: \"error\" };\r\n  } finally {\r\n    clearTimeout(timer);\r\n  }\r\n};<\/code><\/pre>\n<p>Because <code>deliveryDate<\/code> contains a space, set the block to <strong>JSON<\/strong> validation. Branch on <code>orderFound<\/code>: <code>true<\/code> plays <em>&#8220;Your order is $.External.orderStatus and should arrive on $.External.deliveryDate&#8221;<\/em>, <code>false<\/code> asks the caller to re-enter the number, and <code>error<\/code> offers an agent.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_3_business_hours_with_a_holiday_list\"><\/span>Example 3: business hours with a holiday list<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Connect&#8217;s built-in <em>Check hours of operation<\/em> block covers weekly hours. Public holidays and one-off closures are easier to manage in Lambda, especially across several countries.<\/p>\n<pre><code class=\"language-python\">from datetime import datetime\r\nfrom zoneinfo import ZoneInfo\r\n\r\nHOLIDAYS = {\"2026-12-25\", \"2026-12-26\", \"2027-01-01\"}   # or load from DynamoDB\/SSM\r\nOPEN, CLOSE = 9, 18                                        # 9am to 6pm local time\r\n\r\ndef lambda_handler(event, context):\r\n    tz = event[\"Details\"].get(\"Parameters\", {}).get(\"timezone\", \"America\/New_York\")\r\n    now = datetime.now(ZoneInfo(tz))\r\n\r\n    if now.strftime(\"%Y-%m-%d\") in HOLIDAYS:\r\n        return {\"isOpen\": \"false\", \"reason\": \"holiday\"}\r\n    if now.weekday() &gt;= 5:\r\n        return {\"isOpen\": \"false\", \"reason\": \"weekend\"}\r\n    if not (OPEN &lt;= now.hour &lt; CLOSE):\r\n        return {\"isOpen\": \"false\", \"reason\": \"afterhours\"}\r\n    return {\"isOpen\": \"true\", \"reason\": \"open\"}<\/code><\/pre>\n<p>Pass <code>timezone<\/code> as a block parameter so the same function works for every site. Branch on <code>isOpen<\/code>, and use <code>reason<\/code> to pick the right closed message. A plain-English <em>&#8220;We&#8217;re closed for the holiday&#8221;<\/em> beats a generic after-hours prompt.<\/p>\n<h2 id=\"errors\"><span class=\"ez-toc-section\" id=\"Error_handling_timeouts_and_retries\"><\/span>Error handling, timeouts and retries<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The contact goes down the <strong>Error<\/strong> branch when:<\/p>\n<ul>\n<li>Connect can&#8217;t reach the function (missing permission, wrong ARN, deleted function);<\/li>\n<li>the function throws an exception;<\/li>\n<li>the response can&#8217;t be parsed or fails validation;<\/li>\n<li>the timeout is exceeded. In synchronous mode, this goes down the <strong>Timeout<\/strong> branch.<\/li>\n<\/ul>\n<p>Connect also <strong>retries automatically<\/strong> when an invocation is throttled, hits a 500 service error or returns an error: up to three retries, but never past the block&#8217;s timeout.<\/p>\n<p>Two limits are easy to forget:<\/p>\n<ul>\n<li><strong>8 seconds per synchronous block<\/strong>, including retries.<\/li>\n<li><strong>20 seconds in total<\/strong> for back-to-back Lambda calls in a row. Put a <em>Play prompt<\/em> between chained Lambda blocks, both to reset that sequence and so the caller isn&#8217;t sitting in silence.<\/li>\n<\/ul>\n<p>The pattern that works:<\/p>\n<ol>\n<li><strong>Catch errors inside the function<\/strong> and return a status key (<code>\"lookupStatus\": \"error\"<\/code>) instead of throwing. You keep control of the caller experience and still log the problem.<\/li>\n<li><strong>Always wire the Error and Timeout branches<\/strong> to a friendly fallback, never to Disconnect. &#8220;Let me connect you to someone who can help&#8221; is always better than a dropped call.<\/li>\n<li><strong>Set timeouts on everything Lambda calls<\/strong> (HTTP, database), well under Connect&#8217;s limit.<\/li>\n<li><strong>Keep functions warm where it matters.<\/strong> Cold starts on large functions can add a second or more. Keep packages small, initialise clients outside the handler (as in the DynamoDB example), and consider provisioned concurrency for high-volume entry flows.<\/li>\n<\/ol>\n<h2 id=\"testing\"><span class=\"ez-toc-section\" id=\"Testing_and_CloudWatch_logs\"><\/span>Testing and CloudWatch logs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>1. Test the function on its own first.<\/strong> In the Lambda console, create a test event that copies the input event above with your own phone number and parameters, then run it. Check that the output is flat (for STRING_MAP) and well under 64 KB.<\/p>\n<p><strong>2. Test it through Connect.<\/strong> Publish the flow, assign it to a phone number (<em>Channels \u2192 Phone numbers<\/em>) and call it. Add temporary Play prompts such as <em>&#8220;Debug: tier is $.External.tier&#8221;<\/em> while testing, then remove them.<\/p>\n<p><strong>3. Read the logs.<\/strong> Two places matter:<\/p>\n<ul>\n<li><strong>Lambda logs<\/strong> in CloudWatch, under <code>\/aws\/lambda\/your-function-name<\/code>. Log the <code>ContactId<\/code> on every line so you can follow a single call.<\/li>\n<li><strong>Connect flow logs<\/strong>, once you turn on flow logging for the instance and add a <em>Set logging behavior<\/em> block. These show what Connect sent, what came back and which branch the contact took. They&#8217;re the fastest way to diagnose an Error branch.<\/li>\n<\/ul>\n<p>Flow logs are verbose JSON. To make sense of them quickly, paste them into the free <a href=\"https:\/\/kloudmint.com\/\" target=\"_blank\" rel=\"noopener\">Kloudmint Amazon Connect log analyzer<\/a>, which turns them into a readable step-by-step view of the contact&#8217;s path.<\/p>\n<h2 id=\"best\"><span class=\"ez-toc-section\" id=\"Security_and_best_practices\"><\/span>Security and best practices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Least privilege.<\/strong> Give each function&#8217;s execution role only the actions it needs, on only the resources it needs (for example <code>dynamodb:GetItem<\/code> on one table).<\/li>\n<li><strong>No secrets in code.<\/strong> Store API keys in AWS Secrets Manager or SSM Parameter Store, and cache them outside the handler.<\/li>\n<li><strong>Restrict invocation.<\/strong> For cross-account functions, always set <code>source-arn<\/code> to your instance ARN.<\/li>\n<li><strong>Protect personal data.<\/strong> Don&#8217;t log full card numbers, dates of birth or other sensitive caller input. Mask it before printing. If you collect payment data, use Connect&#8217;s encrypted <em>Store customer input<\/em> option.<\/li>\n<li><strong>Save what you need.<\/strong> <code>$.External<\/code> holds only the latest Lambda response, so copy important values into attributes before calling another function.<\/li>\n<li><strong>One function, one job.<\/strong> Small focused functions (lookup, hours check, order status) are easier to test, reuse across flows and keep fast.<\/li>\n<li><strong>Use versions and aliases.<\/strong> Point your flows at a Lambda alias (such as <code>prod<\/code>). You can then ship and roll back code without editing and republishing flows.<\/li>\n<li><strong>Watch the metrics.<\/strong> Set CloudWatch alarms on the function&#8217;s errors, throttles and duration. Slow Lambdas become long silences for callers.<\/li>\n<\/ul>\n<h2 id=\"faq\"><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"What_is_the_maximum_Lambda_timeout_in_Amazon_Connect\"><\/span>What is the maximum Lambda timeout in Amazon Connect?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>8 seconds in synchronous mode and 60 seconds in asynchronous mode. Back-to-back Lambda calls without a prompt between them are also limited to 20 seconds in total.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_does_my_Lambda_work_in_testing_but_go_down_the_Error_branch_in_the_flow\"><\/span>Why does my Lambda work in testing but go down the Error branch in the flow?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually the response format. Check that it matches the validation setting: flat string values for STRING_MAP, with no spaces or symbols. Also check that the function was added to the instance (or has a resource policy), and that it finishes in time. Flow logs show the exact reason.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_pass_data_from_the_flow_into_Lambda\"><\/span>How do I pass data from the flow into Lambda?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Add <strong>Function input parameters<\/strong> on the block (read from <code>Details.Parameters<\/code>), or set contact attributes earlier in the flow (read from <code>Details.ContactData.Attributes<\/code>).<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_Lambda_return_nested_JSON_to_Amazon_Connect\"><\/span>Can Lambda return nested JSON to Amazon Connect?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, if you set Response validation to <strong>JSON<\/strong>. You can then reference nested values like <code>$.External.Name.First<\/code>. Arrays still can&#8217;t be referenced inside the flow.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_one_Lambda_function_serve_several_flows\"><\/span>Can one Lambda function serve several flows?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. Pass a parameter such as <code>action<\/code> or <code>brand<\/code> from each flow and branch on it in code. Keep each function focused, though. One giant &#8220;do everything&#8221; function gets slow and hard to maintain.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_Amazon_Connect_Lambda_work_for_chat_tasks_and_email\"><\/span>Does Amazon Connect Lambda work for chat, tasks and email?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. The Invoke AWS Lambda function block supports voice, chat, task and email. Just remember that fields like <code>CustomerEndpoint<\/code> differ by channel.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Next_steps\"><\/span>Next steps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Learn how flows fit together in our <a href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-contact-flows-guide\/\">contact flows guide<\/a> and the wider <a href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-architecture\/\">Amazon Connect architecture<\/a>.<\/li>\n<li>Preparing for a role? Practise with our <a href=\"https:\/\/techgyan360.com\/blog\/top-100-amazon-connect-developer-interview-questions-and-answers\/\">100 Amazon Connect developer interview questions<\/a>, where Lambda questions come up in almost every interview.<\/li>\n<li>Want hands-on guidance? Our live <a href=\"https:\/\/techgyan360.com\/training\/\">Amazon Connect training<\/a> builds Lambda-powered flows end to end, from DynamoDB lookups to CRM integration.<\/li>\n<\/ul>\n<p><em>Source: <a href=\"https:\/\/docs.aws.amazon.com\/connect\/latest\/adminguide\/invoke-lambda-function-block.html\" target=\"_blank\" rel=\"noopener\">AWS: Invoke AWS Lambda function block<\/a> and <a href=\"https:\/\/docs.aws.amazon.com\/connect\/latest\/adminguide\/connect-lambda-functions.html\" target=\"_blank\" rel=\"noopener\">AWS: Grant Amazon Connect access to Lambda functions<\/a>. Limits checked November 2026.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connect AWS Lambda to Amazon Connect contact flows step by step: create the function, invoke it, handle STRING_MAP vs JSON responses, plus Python and Node.js examples.<\/p>\n","protected":false},"author":1,"featured_media":1054,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1046","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-amazon-connect-hub"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Amazon Connect Lambda Integration: Step-by-Step Guide (2026) - TechGyan360.Com<\/title>\n<meta name=\"description\" content=\"Amazon Connect Lambda integration step by step: invoke Lambda from flows, STRING_MAP vs JSON responses, timeouts, plus Python &amp; Node.js examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Amazon Connect Lambda Integration: Step-by-Step Guide (2026) - TechGyan360.Com\" \/>\n<meta property=\"og:description\" content=\"Amazon Connect Lambda integration step by step: invoke Lambda from flows, STRING_MAP vs JSON responses, timeouts, plus Python &amp; Node.js examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/\" \/>\n<meta property=\"og:site_name\" content=\"TechGyan360.Com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/techgyan360trainings\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-15T18:54:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-15T19:34:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/11\/Amazon-Connect-Lambda-Integration.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1376\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sonu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/\"},\"author\":{\"name\":\"Sonu\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#\\\/schema\\\/person\\\/1904c1c56ff1926dea33c23d57640acc\"},\"headline\":\"Amazon Connect Lambda Integration: Step-by-Step Guide with Code Examples (2026)\",\"datePublished\":\"2026-11-15T18:54:07+00:00\",\"dateModified\":\"2026-11-15T19:34:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/\"},\"wordCount\":2402,\"publisher\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Amazon-Connect-Lambda-Integration.jpg\",\"articleSection\":[\"Amazon Connect Hub\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/\",\"url\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/\",\"name\":\"Amazon Connect Lambda Integration: Step-by-Step Guide (2026) - TechGyan360.Com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Amazon-Connect-Lambda-Integration.jpg\",\"datePublished\":\"2026-11-15T18:54:07+00:00\",\"dateModified\":\"2026-11-15T19:34:03+00:00\",\"description\":\"Amazon Connect Lambda integration step by step: invoke Lambda from flows, STRING_MAP vs JSON responses, timeouts, plus Python & Node.js examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#primaryimage\",\"url\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Amazon-Connect-Lambda-Integration.jpg\",\"contentUrl\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Amazon-Connect-Lambda-Integration.jpg\",\"width\":1376,\"height\":768,\"caption\":\"Amazon Connect Lambda Integration\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/amazon-connect-lambda-integration\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/techgyan360.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Amazon Connect Lambda Integration: Step-by-Step Guide with Code Examples (2026)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/\",\"name\":\"TechGyan360.Com\",\"description\":\"Your 360\u00b0 Tech Learning &amp; Career Growth Hub\",\"publisher\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#organization\",\"name\":\"TechGyan360.Com\",\"url\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/Gemini_Generated_Image_lkkuvilkkuvilkku.png\",\"contentUrl\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/Gemini_Generated_Image_lkkuvilkkuvilkku.png\",\"width\":1408,\"height\":768,\"caption\":\"TechGyan360.Com\"},\"image\":{\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/techgyan360trainings\",\"https:\\\/\\\/www.youtube.com\\\/@techgyan360trainings\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/techgyan360\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/#\\\/schema\\\/person\\\/1904c1c56ff1926dea33c23d57640acc\",\"name\":\"Sonu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d9eed09c873acdf4595ae8aabd56ed75c615f7c4814f73a6610e893f9eaa9c1e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d9eed09c873acdf4595ae8aabd56ed75c615f7c4814f73a6610e893f9eaa9c1e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d9eed09c873acdf4595ae8aabd56ed75c615f7c4814f73a6610e893f9eaa9c1e?s=96&d=mm&r=g\",\"caption\":\"Sonu\"},\"description\":\"Sonu is a Technical Content Writer, Editor, and Manager at TechGyan360, specializing in blogs and articles. With over 8 years of experience in technical content and a broad understanding of diverse technologies, Sonu brings expertise in Cloud Computing, VoIP, Cloud Contact Centers, Web Development, and Blogging. Passionate about simplifying complex technical concepts, Sonu creates informative, engaging, and high-quality content for a wide range of audiences.\",\"sameAs\":[\"https:\\\/\\\/techgyan360.com\\\/blog\"],\"url\":\"https:\\\/\\\/techgyan360.com\\\/blog\\\/author\\\/techgyan360-in\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Amazon Connect Lambda Integration: Step-by-Step Guide (2026) - TechGyan360.Com","description":"Amazon Connect Lambda integration step by step: invoke Lambda from flows, STRING_MAP vs JSON responses, timeouts, plus Python & Node.js examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/","og_locale":"en_US","og_type":"article","og_title":"Amazon Connect Lambda Integration: Step-by-Step Guide (2026) - TechGyan360.Com","og_description":"Amazon Connect Lambda integration step by step: invoke Lambda from flows, STRING_MAP vs JSON responses, timeouts, plus Python & Node.js examples.","og_url":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/","og_site_name":"TechGyan360.Com","article_publisher":"https:\/\/www.facebook.com\/techgyan360trainings","article_published_time":"2026-11-15T18:54:07+00:00","article_modified_time":"2026-11-15T19:34:03+00:00","og_image":[{"width":1376,"height":768,"url":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/11\/Amazon-Connect-Lambda-Integration.jpg","type":"image\/jpeg"}],"author":"Sonu","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sonu","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#article","isPartOf":{"@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/"},"author":{"name":"Sonu","@id":"https:\/\/techgyan360.com\/blog\/#\/schema\/person\/1904c1c56ff1926dea33c23d57640acc"},"headline":"Amazon Connect Lambda Integration: Step-by-Step Guide with Code Examples (2026)","datePublished":"2026-11-15T18:54:07+00:00","dateModified":"2026-11-15T19:34:03+00:00","mainEntityOfPage":{"@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/"},"wordCount":2402,"publisher":{"@id":"https:\/\/techgyan360.com\/blog\/#organization"},"image":{"@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#primaryimage"},"thumbnailUrl":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/11\/Amazon-Connect-Lambda-Integration.jpg","articleSection":["Amazon Connect Hub"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/","url":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/","name":"Amazon Connect Lambda Integration: Step-by-Step Guide (2026) - TechGyan360.Com","isPartOf":{"@id":"https:\/\/techgyan360.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#primaryimage"},"image":{"@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#primaryimage"},"thumbnailUrl":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/11\/Amazon-Connect-Lambda-Integration.jpg","datePublished":"2026-11-15T18:54:07+00:00","dateModified":"2026-11-15T19:34:03+00:00","description":"Amazon Connect Lambda integration step by step: invoke Lambda from flows, STRING_MAP vs JSON responses, timeouts, plus Python & Node.js examples.","breadcrumb":{"@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#primaryimage","url":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/11\/Amazon-Connect-Lambda-Integration.jpg","contentUrl":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/11\/Amazon-Connect-Lambda-Integration.jpg","width":1376,"height":768,"caption":"Amazon Connect Lambda Integration"},{"@type":"BreadcrumbList","@id":"https:\/\/techgyan360.com\/blog\/amazon-connect-lambda-integration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techgyan360.com\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/techgyan360.com\/blog\/"},{"@type":"ListItem","position":3,"name":"Amazon Connect Lambda Integration: Step-by-Step Guide with Code Examples (2026)"}]},{"@type":"WebSite","@id":"https:\/\/techgyan360.com\/blog\/#website","url":"https:\/\/techgyan360.com\/blog\/","name":"TechGyan360.Com","description":"Your 360\u00b0 Tech Learning &amp; Career Growth Hub","publisher":{"@id":"https:\/\/techgyan360.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techgyan360.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techgyan360.com\/blog\/#organization","name":"TechGyan360.Com","url":"https:\/\/techgyan360.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techgyan360.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/05\/Gemini_Generated_Image_lkkuvilkkuvilkku.png","contentUrl":"https:\/\/techgyan360.com\/blog\/wp-content\/uploads\/2026\/05\/Gemini_Generated_Image_lkkuvilkkuvilkku.png","width":1408,"height":768,"caption":"TechGyan360.Com"},"image":{"@id":"https:\/\/techgyan360.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/techgyan360trainings","https:\/\/www.youtube.com\/@techgyan360trainings","https:\/\/www.linkedin.com\/company\/techgyan360\/"]},{"@type":"Person","@id":"https:\/\/techgyan360.com\/blog\/#\/schema\/person\/1904c1c56ff1926dea33c23d57640acc","name":"Sonu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d9eed09c873acdf4595ae8aabd56ed75c615f7c4814f73a6610e893f9eaa9c1e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d9eed09c873acdf4595ae8aabd56ed75c615f7c4814f73a6610e893f9eaa9c1e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d9eed09c873acdf4595ae8aabd56ed75c615f7c4814f73a6610e893f9eaa9c1e?s=96&d=mm&r=g","caption":"Sonu"},"description":"Sonu is a Technical Content Writer, Editor, and Manager at TechGyan360, specializing in blogs and articles. With over 8 years of experience in technical content and a broad understanding of diverse technologies, Sonu brings expertise in Cloud Computing, VoIP, Cloud Contact Centers, Web Development, and Blogging. Passionate about simplifying complex technical concepts, Sonu creates informative, engaging, and high-quality content for a wide range of audiences.","sameAs":["https:\/\/techgyan360.com\/blog"],"url":"https:\/\/techgyan360.com\/blog\/author\/techgyan360-in\/"}]}},"_links":{"self":[{"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/posts\/1046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/comments?post=1046"}],"version-history":[{"count":4,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/posts\/1046\/revisions"}],"predecessor-version":[{"id":1074,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/posts\/1046\/revisions\/1074"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/media\/1054"}],"wp:attachment":[{"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/media?parent=1046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/categories?post=1046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techgyan360.com\/blog\/wp-json\/wp\/v2\/tags?post=1046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}