{"id":8,"date":"2021-10-23T11:10:52","date_gmt":"2021-10-23T11:10:52","guid":{"rendered":"http:\/\/18.141.20.153\/?p=8"},"modified":"2025-08-22T08:15:50","modified_gmt":"2025-08-22T08:15:50","slug":"how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs","status":"publish","type":"post","link":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/","title":{"rendered":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">10<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p><img src=\"https:\/\/lh6.googleusercontent.com\/ZG6yx85DcUQzZ_SFMtYAqBoH3dPCl4o-wHvam1W6O0JEY4eyZCNcFc9iS1l90Q0071t92s1UUCcR8T5uzJilOoj6PTB5qSwa8ObDS2HnFiacTzkOWm0gJkQoNiTbujwFjCHJDMA1\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">Since the term was coined in 2011, Microservices have been making waves among forward-thinking application development corporations. Microservices help decouple application components so that they run and fail independently, increasing the overall fault tolerance of the system. When your application is decoupled you need them to communicate in a seamless way to avoid any delay, this is where Queue-based Microservices come into the picture. Using AWS Step Functions and Amazon SQS you can easily orchestrate Queue-based Microservices. In this blog, we will simulate inventory verification requests from incoming orders in an e-commerce application as part of an order processing workflow. We will see how to use AWS Step Functions, AWS Lambda, and Amazon SQS to design and run a serverless workflow that orchestrates a message queue-based Microservice.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we will demonstrate step-by-step instructions on how to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS.<\/p>\n\n\n\n<h2>AWS Step Functions &#8211; Recap<\/h2>\n\n\n\n<p class=\"has-text-align-justify\"><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-build-a-serverless-workflow-with-aws-step-functions-part-1\/\">AWS Step Functions<\/a> is a serverless function orchestrator that makes it easy to coordinate multiple AWS service components of distributed applications and microservices using visual workflows. It is a reliable way to coordinate components and step through the functions of your application.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/mimMch-WZjHrEQMGMhYkZkNmeAdYSgUN8F4_dq2jNyxITrS5vq6pR-MkaMvHqTjC16l6CJ-nNPYMUyNE6llWB0bzVRwChLVoqYtJIMsst90EIvt438M3Fy2IiRYliGMvz7o1_mdW=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">When your distributed applications become complex, the complexity of managing them also grows. With its built-in operational controls, Step Functions manages sequencing, error handling, retry logic, and state, and provides a graphical console to arrange and visualize the components of your application as a series of steps. This makes it easy to build and run multi-step applications. Step Functions automatically triggers and tracks each step, and retries when there are errors, so your application executes in order.<\/p>\n\n\n\n<h2>Amazon SQS &#8211; Recap<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">Queues are a great way to mix and match software structures. They allow non-simultaneous communication across separate systems, which is particularly beneficial when the system\u2019s output is uneven. Amazon\u2019s version of queues is called <a href=\"https:\/\/aws.amazon.com\/sqs\/\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon SQS<\/a> or Simple Queue Service.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/3XJUFxIEnkOOCyTuosblD5VGz7UDClEcpEJf2t-AxJtg1BUdtmMw81G1ufgi2m2Zby6gvnhlhGPlA1iSjCvexDbzQ6kGsuzgIuOAu6SQnQNQHhZ4B8Nq2x0Xjzm4rBD1bx-KLiAZ=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Amazon SQS is a hosted queue that allows you to link and disconnect distributed software systems and components. It is safe, durable, and available. SQS removes the complexity and expense of managing and operating message-oriented middleware, allowing developers to concentrate on unique work. SQS allows you to transmit, store, and receive messages at any volume between software components without losing messages or necessitating the availability of other services.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/j_U0750JiefeWn-CihvluO-jcxZb1x7yMUNLb-Vkn-PZFxWwYGZwsRNq86g4b3zEAAFiGES15t1Dx6KQe8-3Ho6m_dqKHXkzqhcAL1ATj64hRdrw4FEWp9VkyCj_v4ftxgHTzwlw=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<h2>Hands-on<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we&#8217;ll look at how to utilize <a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-build-a-serverless-workflow-with-aws-step-functions-part-2\/\">AWS Step Functions<\/a>, <a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqspart1\/\">Amazon SQS<\/a>, and <a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-do-event-driven-programming-using-aws-lambda-with-amazon-kinesis-streams\/\">AWS Lambda<\/a> to create a serverless workflow that orchestrates a message queue-based microservice. The storing of inventory verification requests from incoming orders in an e-commerce application will be our use case for SQS in this hands-on. As part of an order processing workflow, this hands-on will mimic inventory verification requests from incoming orders on an e-commerce platform. Inventory verification requests will be sent to a queue on SQS via Step Functions. We&#8217;ll use AWS Step Functions to create the process. A microservice will be used to verify inventories in the workflow. A queue is used by many microservices to receive requests. To illustrate the microservice in this hands-on, we&#8217;ll utilize an AWS Lambda function. A task state is used by the state machine to place a message on an SQS queue. A callback pattern is set for this task state. When you add to the end of a sentence, it&#8217;s called an appendix Step Functions will add a task token to the JSON payload and wait for a callback if you add waitForTaskToken to your resource. By contacting the Step Functions API, the microservice can return a response to Step Functions. Your inventory microservice will be an AWS Lambda function that utilizes a queue to buffer requests. It will verify inventory after retrieving a request and then deliver the result to Step Functions. A callback pattern is created when a job in Step Functions is set up in this manner. Callback patterns allow you to integrate asynchronous tasks in your workflow, such as the inventory verification microservice of this hands-on.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/86_aQ1_f1mqDiljbzO-f2YPhboSkYcIKcd4VG5wVWIXRiod3CQ6NZym4ZP8yvWTL79gxXquOB1OLJgXjOhK3P7khvb2myjnyZ7RGA4Q9BlSB_MFOL3hVYmHVHOxW5adkM1ewo1XM=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p><strong>To implement this, we will do the following:<\/strong><\/p>\n\n\n\n<ul><li>Login to your AWS console and navigate to the dashboard.<\/li><li>Navigate to the SQS service dashboard.<\/li><li>Create a new standard queue with the configurations provided.<\/li><li>Navigate to the Step Functions service dashboard.<\/li><li>Create a new state machine with the workflow code provided in this blog.<\/li><li>Navigate to the IAM dashboard to create a new role.<\/li><li>Create a new role with the described policies for SQS and Step Functions in this blog.<\/li><li>Navigate to the Lambda function dashboard.<\/li><li>Create a new function attaching the created IAM role and adding the code provided in this blog.<\/li><li>Attach the SQS trigger as the source trigger on the Lambda function dashboard.<\/li><li>Navigate back to the Step Functions dashboard and start the execution to test the configurations.<\/li><li>Check the execution result for success or failure.<\/li><li>Explore the Execution event history to check the execution results.<\/li><li>Finally, explore the Graph inspector on the state machine dashboard and test the workflow execution results.<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify\">Log in to the AWS account and navigate to the console.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/fpWjeca96-Va7-BrincCLEOaTtXDSgAVUyqTbs3nW0yDa9Yz5Dbz0GY0dqK0jM5c_20nzyWJsJgwEzMkDNCAc7cE_54rl_on2jjUDlPdhaZ8477myqAzUHEJASW4PU_bm_XnZyOV=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Search for the SQS service and click on it to navigate to its dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/8njfoxtONabqtuxCdkQsXAkccItF9KjRzyHC4uJsy7-1C3iiJxealB4LA2_AOYyiigGTyRbh6Tg6D93ocNR16XEbbOOgTi7Y5KdeRohHyvWv3T9PJpkzuasg6W5AaQgBJ4aVA5nA=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On the dashboard, click on Create queue.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/VdxCfQBINirsi7qFbYgz8M-JuoK6oyfcpVpV_PFZxyjK9wElQmJ4RFP4IPFtg9lUSqAACFsT9YKgv3RwT1ywGGr5dEfYP1w-CAV8RLKJ_xnICBs_bwkli7QoZyp9HaGOIrr-voEV=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will be navigated to the page as shown in the image below. Choose Standard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/lNmVV95Yvkr0YM50ZYyB61-zFYbDaBStQ84lKhotdjnTxS-2mG33alk9CY14uSrO7yaYuiGtpmMP2ucg9QvWGgKd7FZa1dW5vzkI3a5ktSY0Zlmv5vmFsQrn_DM2o7R2mV5HAr41=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Enter a name for the queue and make the configuration changes as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/1z61KOmCkTY8m28OkR0siWegz4bpYAk_0fZ3tmma_82j8ISDthcOmHk367-HPdNe4NFytoihVLvz9opJYY5XGEP5pwArzcrTEe1T2MarU4149egYeTQCUm5i0NL5dMGlV3xNuNJ5=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Keep the Access policy as default.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/qda659-gVRi-ZAYmwmjX0yzCJF9o7mqqNnIsqj9TiHeXMGHUbZLUlMWpJcTAc8EjeJsjurBOU5ARHwmK0oe91Nnozdl6ZpXVxQC6ejp-FAOc3Byy6AXWL5wD2UO7BGOr8tvCHFPC=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Enter tags for your queue if any and click on Create queue.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/a3NeWIBSJquNIF0fa3uFC76x-6OCCBzwwjNUpYqx-SdaNckPsf8Yu-cLAp7WO3rY9JxOPdcARz0upkp708V2iS-WxIlhBrBcoVtVyhRoe6aH7sT4V9DlTTIwacbzjzt0JOnlstLl=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the message as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/AxVvc0vpf3FhW4FZ8pe4mNYFU3fGyiEh92a_21jpwqtMk0zSaZqZ95vJI2Y5SMJyse0BEuQdyaGV6q3V4ncgHxxQwKvDmMpLmx0qTylkHeb_TDbLql9y71laAqIUASFCM8D-fnfQ=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Search for the Step functions service and navigate to the dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/kI7ScDNO1NzjZwySZoRB1wvNLqHJUaXAi3v7EVOde8wo4WMdkxB1CjRKLNl8UGbZgeEH6JNe5MQ5trkPdeG-lMepmRCsZyjIlSBLdPLwEP7q2u8k35WAb51uddpGa2udWSH1u1N8=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On the dashboard, you can have a look at the pricing structure for Step Functions.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/cMhrD5OS9xt0qUZADb6o8ZZUdT-hfwOEvZO9YKFU8zzkwOYtHYSj7Crs_G8t05HZGAukOwpnyj0i4xr8H6FXwKp_vQqTRkdCN3-kcFRB2cd8RQlNvyAYRUPFOLhepzyFtuN0CrPC=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>How it works has an interactive demo added to the dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/Gar6vVAjOlngZh-hpHWNvPZP0EwU8e6qQPRbX_6UZYzVQRDh0AmkEHsozFpeV-30W7ON6yY1yxJZvOkX93FmMuAMy6bZ-WvvRgbEcS4D1LaVwCB8rNLRrPVypTycCtwiZWbYlhsy=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Expand the left navigation pane and click on State machines. Click on Create state machine.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/bcwzpi9yj2z7SISxHdhtYs1qT4T1Ja4L7bUaJWvziTNe8ZRhFDxN4KeFz1VBBNN0ds-W6ieGgtQ4eqYTCdpWANLvYQGthQnHsRQU1yAdoOAw0NoOYj3qs1OHCigGIbHPIeQeI8Ll=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select the options as shown in the image below for the workflow and the type of the workflow.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/5vqt189UZUYXmL9QkMUj6WkeXoQavYg-QXvsJ1OJU_d53KoIdWOiPVl-SzgsTVDPmHbVHxhHFer24j2cqGu8P7n8Z0AEg-s38sxUUjEpk87FFaHquThCSpps-wGkD3kWx2RT5F5p=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">In case you are confused with which type to choose, you can expand the Help me decide and make a call for the same.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/XFN86-SMEzI7nivRn8bteGoNCFxc3Hq6Ls-v-fDqepECbZsYy9vQ6VqbuQKQ6UkisPrVexCSpQ-e1nfqNLf-3BBVq2665JXkyk6o5ISLS8Ih8RLI7xDTMBWoHzzpEMFV3tJroB9-=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Now, scroll down to the definition.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/Oj2pRHW5VePvIzhHRGlItSkfc3w11QTM2VD-K1gdMJSOSjnwVixGoVh6iHXDPq9xW_3jMLUZbHeqIownZExi0WwWPqWSXWkQF1wOhfU4Y7RN6j_msmK3vNIXtYsDjpIIwnhCVuyC=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Copy the below JSON and add it in the editor.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  &quot;Comment&quot;: &quot;An example of the Amazon States Language for starting a callback task.&quot;,\n  &quot;StartAt&quot;: &quot;Check Inventory&quot;,\n  &quot;States&quot;: {\n    &quot;Check Inventory&quot;: {\n      &quot;Type&quot;: &quot;Task&quot;,\n      &quot;Resource&quot;: &quot;arn:aws:states:::sqs:sendMessage.waitForTaskToken&quot;,\n      &quot;Parameters&quot;: {\n        &quot;QueueUrl&quot;: &quot;&lt;INSERT SQS QUEUE URL HERE&gt;&quot;,\n        &quot;MessageBody&quot;: {\n          &quot;MessageTitle&quot;: &quot;Callback Task started by Step Functions&quot;,\n          &quot;TaskToken.$&quot;: &quot;$$.Task.Token&quot;\n        }\n      },\n      &quot;Next&quot;: &quot;Notify Success&quot;,\n      &quot;Catch&quot;: &#91;\n      {\n        &quot;ErrorEquals&quot;: &#91; &quot;States.ALL&quot; ],\n        &quot;Next&quot;: &quot;Notify Failure&quot;\n      }\n      ]\n    },\n    &quot;Notify Success&quot;: {\n      &quot;Type&quot;: &quot;Pass&quot;,\n      &quot;Result&quot;: &quot;Callback Task started by Step Functions succeeded&quot;,\n      &quot;End&quot;: true\n    },\n    &quot;Notify Failure&quot;: {\n      &quot;Type&quot;: &quot;Pass&quot;,\n      &quot;Result&quot;: &quot;Callback Task started by Step Functions failed&quot;,\n      &quot;End&quot;: true\n    }\n  }\n} \n\n<\/pre><\/div>\n\n\n<p class=\"has-text-align-justify\">The graph will then change to as shown in the image below.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\"><\/div><\/div>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/mJC8CD5zn9Je1y3QP8IKYHJkrq4OIlv4qvOMng7uXlmO4YgVLnjpbvJU6qQCs9SxIALEFlyHO14qOzc-HA1y2uzIyPSKw6X3AesfTswn_et9Zk9zhhcivIeytKnHlYwZeQa4kmmd=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, navigate back to the SQS queue dashboard. Copy the URL of the newly created queue.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/rutevw4yKK1KaaPV9SNBLJyEhvpmcqxWQFDmuz5vjE-qtlbR4NiDuO9lFqn_-BgwDqNR8BFw3Sa41-6hfZkfXLXO5C_Bp-ldqA09oXCMIuoIKVvxXPkVLktp-mXAQLbw4thh0sWO=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Paste it beside the QueueURL key in the editor pane. Scroll down and click on Next.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/HTjxpFEcI-XcZU-gfDOVRuHCiLlpwN0olfEPPF3jBj_He18qFblnEHeAK0i1S6WOHOWPD6t--tj5__Ugun5cV-dWleksTGG-oSX-NwzAkQy7YxeKKcxVQhMz6pH_GEzI9bACkfST=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Enter a name for the state machine and select create a new role under permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/2JK2LmrDMoWDygDgaxrqDj4AXrS7ij4tbDpq2K6eMK9zshzkO3AbBzB6t5SY0Gl09aTlgklvH5kZ_C5mUe8nGPgRi4sSHleg98SWCFekENIChAfY6z43wcigGi6U0xbH_TKjCCai=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Add tags if any needed for your state machine.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/nuTB0Ww0KJUbp_5h-p7dHHojGIc0x_QpG99UaDyCGLEZxnRqE6_SfZyBenmH6t-Mg6DQILkP0LKgeuJO6QxXmFltkssHuTv08YB92lNqzfxLYeETXCA5vmvPkBOLir4fC8U_GHMM=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Once done, scroll to the bottom and click on Create state machine.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/YDFhYftFM58njgfcvn-oWlPES2qolcpZUoi342NiwGylU5a5wCTywVcMDI3gB2r7DprjoRcNy7t1LMcEnlJNGgzx2TY7YkgUG-01xgsDapwNV3QzUv33fvfz-v5mQpYAPkxg2UT-=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the message as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/vrwgerM8E-7MT5ytE5i4fpSLY6Tvp0_imG1kPYiKnAzDClLCxPRVfCU98SzGpG5BS-RdrNs1ii2OBp2-FGGg7AMBIu53ElBQ6ZswdZaeiMoOlCIQuOAAOpIa2e79wEU4Vv3z36_g=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Now, search for the IAM service and navigate to its dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/DRLaqodWuCxQxnsKflyasUEtYiD9mAt4bEdesHdDbqxLzLor4hISRmSU9gtjxUK4o2Wnh0L6mPVHnKHnT_BkcJhk-HZ_ODmg9xKAUGlPH-b8r2_d33s5x9stz-dPfKC7x_FjKtaK=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select Roles from the left navigation pane.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/4V3hT9glccpQIhl1oayoq6bNRpM-JmPFgCilfpY9SARR8SzSgKruUjUBv_fryEAyN_-SvizdKCvFgRRRsKhzrif4UBI56FwvoeH1f3lZGt33MyviQYxRvxCvvdrSBhkV6RZ9g976=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Click on Create role on the dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/iHKAb55fmjRxHHppxdTd3OskauCK_7i-QU1mJ_8qivvJMv7O5rhVXjB6a-9-_u-Iskol_cKANC-DsmE9ogeRM66WP78gL13FUx5EqXD8xNPPBxEvaJkgwkkwDOuXA_ZIdEAQcszq=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select Lambda under choose a use case and click on Next:Permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/DBuaE9rgVCgdpNVz9l_7aGk-zC4rTA2tzogtiaL_B5wdQDpKigi6-x9WR_TPa3K4MGgvWJDAieRBUj90SkzpYXAuyWKgyhFy0Xs7rSX7-RJpCuWpGM6TzFz_2vY12cJ1iGD-6ENF=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Search for the AmazonSQSFullAccess policy and check the box.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/rWRqPRX9Qm2pel5d6Bhsgv_z9MdN1K8Z7Lld8IsLgRcBgTOd_UYdhIUC7pQ5ua_NFsKaw793k-oAy6uVkW9Ud_u9riRunNEGLb01pt0EQ3bIJU0adXloz_UaGKMLa1ljUBz4o43M=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Search for the AWSStepFunctionsFullAccess policy and check the box. Click on Next: Tags.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/RFH_dM0ev_ojstijBuxP97AfbjoeIA5kULoXA2vkw4kGQEWgGPYkSrUXWWmyh10IMGKz6zef_TH3ND3oyR4yqImYqvBmM828fs0K8nglezX1nSWT0AQZIKsfcBfDISpQTMKhwZpx=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Add tags if any needed for your IAM role. Click on Next: Review.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/pDFakq5sFYayk0sLPSOLt8e1EWIM_er5ieOXopS3kmVo-as3L_bhC0ZlHX5heAOiIiWr7baOO0wADJwe40RgVxC28pmSnjheM5l3jjkkySv1QCHNVojgpk_9Jg7XlEWlvz1ie-_j=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Enter a role name for the newly created role. Click on Create role.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/bbaa7nZrCj7TDcAtOn_5xBKLhUFOvpX8-Iv6m0hHUitJmHRdQEIa0hdSTxv-16QA-7oMURUR-Pp9qwYikNKJQJKOFcTeq9qcYiKpZEq4BL8dQ-37cX1B011Cx4aEUwq6qTfw_O5b=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the message as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/tr-EIMdbx6EDqSp5nsDSqmNDdwrChb-Sx2iDVPPL6KQUbYYeqb5p0BBZZdlfSfG5rzmrlzrUReD37EDmDMMww-A-vwra8x2ATAPs0KbEsVvyVv_p9TE-nZYKEfH0oPm5GjWeU_Gq=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Now, search for Lambda service and navigate to the dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/9saWazCicGBn6hmMiUojD1jN66Ql5VvYhNUzXGZoTIlZiT2xF_EnGQ_8BM0Ejp3BVPez9RAc9T8jqP-Q6gXET_ffMFBth3fLgBtop--ffsIpGl6hFgW-AIYJ_L-GpeNaVkzslNuK=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Click on Create function.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/FSM74TxDFTq4649HmlogOfdgZyy7rxdgBA8WvvyiRd7ybiSJjLscb0Ado4mea_RjwpnB2DD87BXU6IY0IHni7BrMsKHlhWN4lq69hpZ52U9Nzg5wwElRLbFWnoUR1FNXLLdWypwd=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select Author from scratch, enter a name for the function and select the runtime as Node.js 14.x<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/lyePsuHhFM2eL6hgT_r8CegaWDEDX7__r4PBHluIo8H4LpSMppy34LqB1lyvV65GldyzB4Qqx6HPSP36pXXhQK7dRXxhQHX5beYxkAWQsnVXl1zSDjYzsnFQi56JaMv8_hjUUO_T=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Select Use an existing role and from the roles dropdown, choose the newly created role.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/2N1xWr3OzLYrkLRNU2eBEJd6YxkDiGfqnu9yv5_6__cxmXJR3svRlUBqex3KMEEw_nDhT8bX7TowVtQr33YOJ7xjh9bSy1b4Kiqel8gHAqwb1yzB2oq5yq0HblyqiW23j16XCp5F=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Scroll down and click on the Create function.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/PBeyZG5qxfM-lnN4X30CB2LgbZtNASLcW7ZVhtpQ8GM8kfP53yP7rtdBsJSDHPJje9E775-R8qadIpPBuYtUmcYbQTrJFGO9MqD0SBbIZqzOSd9tPOlrhaFpwkDMxJhF9decORua=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the message as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/OXX6OyRsDUQdgKM69zA0kQL5rTigYalEjUU5JOd4rFEF5lRsJaki6Yk0TeXmDCRgiZ-whzC8qu5C2BiVK5L7lwG9uBucrNsnNH_gHOlVVPZI7nqzzYtAmP8D3pmvsfFZ7dHvDDKN=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, navigate to the code editor pane and paste the below code in the pane.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconsole.log('Loading function');\n          const aws = require('aws-sdk');\n          exports.handler = (event, context, callback) =&gt; {\n              const stepfunctions = new aws.StepFunctions();\n              for (const record of event.Records) {\n                  const messageBody = JSON.parse(record.body);\n                  const taskToken = messageBody.TaskToken;\n                  const params = {\n                      output: &quot;\\&quot;Callback task completed successfully.\\&quot;&quot;,\n                      taskToken: taskToken\n                  };\n                  console.log(`Calling Step Functions to complete callback task with params ${JSON.stringify(params)}`);\n                  stepfunctions.sendTaskSuccess(params, (err, data) =&gt; {\n                      if (err) {\n                          console.error(err.message);\n                          callback(err.message);\n                          return;\n                      }\n                      console.log(data);\n                      callback(null);\n                  });\n              }\n          };\n<\/pre><\/div>\n\n\n<p class=\"has-text-align-justify\">Click on Deploy to deploy the new code.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/E9PvMkgDler-m3s9pZb6IUvAaeAeVU2Ir2vEkuy4rzsaxGPYxng9bcQnYjE_lGPFe-R8m8VKva43F_i0pArAZAu9ANJgjYnjXfMA_NJPdsaJV9HsAoUFWG8wmfGcsT72FgCtRb9Q=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the message as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/qEXD3xcCeFHHXCUfZMAWlWCG-EdVwjCC3COFLkPmB23RClaqKeEnnTMBr_ord_x4Mg_eoUnlEob8KVpmKwTz81FF-EinAa22PYDr7gG9aU_rjUQwOP3nMCc7ANZ5JhWdRIgjvGSJ=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Scroll up and click on Add trigger. Make the configurations as shown in the image below. Click on Add.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/pAm7cKMI8jmSKaGYPHbFukhhPfSJGHTfFBpzWdzfEDgmqf8PC-fsHHmnCgp1uotYoPdNKuzkDaFKRPAZWuTGSMHnpU24bQZXX52_k-V3sce_baY7mgLpoQZavWPMDpRrjQfQFm8u=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On success, you will see the message as shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/zfCOco3e1a0HSoR_7Pj5k2YCoGjAfdShNk1E6HJyn-hLNy9Hn2CW4DJ-jLlAfq9wZZ4PiVP84GRnKdP187-Oj16QSowx-EPt9VEyR2I0hqbd8XVgFoPBT87E0JyFIaZ7LTeOj0LB=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Navigate to the State machine dashboard and click on Start execution.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/qUBvv31ZyxvT5IATJ2xpK6C84WyRn5uUK3v_V5LQ243GUcl9Bjk3_ORBCK8XKWzY81R4BAb1g5BFy08NBvYxmEbVwGHOAATEmHz7z4PGczWyhxToqhBh1nQEfw96WJq7WSSs3Ub0=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">A modal will appear, click on Start execution.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/TQnDDDmw9I37vJ325ZXmQm-WTBitK6kbOGd2LzqDTtXDHEgK2G3L0C83Hyaw_vQ-VAQpv5c23DM3D0ELr-MeeI97WU9XTqva0srxoOnpPfOytgEOCl6XXAc4fiLi5nHwDG5LXMcl=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">The process of the workflow will begin and will take some time to be configured.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/X85eQmBdPXF0V8jDiyYgg3nqPuQRIw1BnC4npzueHINp-HRcMIZAZDjNi0A-GhXHXfmO5cTgdwTPz0EYKOCZKocHpHVXvsNX0A3oxEjM6vesCm2DsoNlnEWN8aj4cF3ipnRpO5gv=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On Success, you\u2019ll see the states turned to Green.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/r9xHaZaArB0Zdnc7WuYbBsGf4tRTy3dJc9lLzRvuN9EiyFvc_miK_BpQkzVwOCqSL0JNhDsneDng-47gYBFioYqwWISJ4NEWnwDzoj12Bo8_jjpL3He4uZCfi3uKFz4BohsRlSga=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">If you scroll up, you can check the Execution output tab to see the output of the execution.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/SrFtORK_ziqazvNdDfgxFmOuYBMixQIpjE4cAVrYmdLOYoiKa8IYkxw33N_dL8BazASO8Eaxj1s1m94AVEfMGijgNYXtgCKtwt49f81sY3sBv-bayvBNU_EGWP3P9KbH7gO06F-J=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Click on any of the state and you\u2019ll see the Details for the same.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/1sgELXm8Yk6ih0oCCspgnP4sS8uXekz_ERgeLS1kHu7KqHUQ5i70txU7XvR2PLe_MP1PaXFk5nZAfjCgCj2AaxOaIB3R_QFW6CTbkh0oPp_dgLw-88y-6vG390dmSnhskDz-Rn3F=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Under execution event history, you\u2019ll see the flow of execution.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/pD8KYcuI16PjjE0Q4Yn1tH1OuoUFgvwjkLYcQyBsjhpypNW7APcbzXcERXqUMiv-5XUrvs42xL65RfIKR2FgyVyFk5ic4aMbX6xw7lu8khAPeCqXe6v6mBqV4lb4kbHJztBPGBRX=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Expand one and you\u2019ll see the output for the same.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/SQWrginoSvlJPGl6kTntIOPSm1vxZEQpBC44-bnxnUouG_XQnTJgOSs31PhkTOLPnzbmnn5jhSFAFHKmQGoeKbCqCgV9d1yYyoWcIKSfDhALq-nn575KQLsOYeUYjoxUK_WRu-4Q=s1600\" alt=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">In the Step output, you\u2019ll see the Success message for the execution.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/I2bYhP-1-Et_cZHpOJeUJXSiZ6gckJ1xsGhkJhVHGpEZCIfSIVEFYisOll2LgjDIRxDZSH5Ncvh1yaYXlMryaDSWHQSRtSbVxUwKLHnrIDy0Up-HKVWgYzisn80Tu0odmj-dtXiu=s1600\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Conclusion<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we saw how to use AWS Step Functions and Amazon SQS to design and run a serverless workflow that orchestrates a message queue-based microservice. We first created an Amazon SQS Queue to simulate the storage of inventory verification requests from incoming orders in an e-commerce application. Then, we created a workflow with a state machine to describe how we wanted e-commerce orders to be processed. We then created a new role on the AWS IAM console to allow AWS Step Functions and SQS full access policies to the newly created role. We then created a microservice queue-based execution with AWS Lambda Functions. We will discuss more use cases for the services used in our upcoming blogs. Stay tuned to keep getting all updates about our upcoming new blogs on AWS and relevant technologies.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Meanwhile \u2026<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong>Keep Exploring -&gt; Keep Learning -&gt; Keep Mastering<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">This blog is part of our effort towards building a knowledgeable and kick-ass tech community. At <a href=\"https:\/\/www.workfall.com\/\">Workfall<\/a>, we strive to provide the best tech and pay opportunities to AWS-certified talents. If you\u2019re looking to work with global clients, build kick-ass products while making big bucks doing so, give it a shot at<a href=\"https:\/\/www.workfall.com\/partner\/\"> workfall.com\/partner<\/a> today.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">10<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> Since the term was coined in 2011, Microservices have been making waves among forward-thinking application development corporations. Microservices help decouple application components so that they run and fail independently, increasing the overall fault tolerance of the system. When your application is decoupled you need them to communicate in a seamless way to avoid any delay, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":274,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2],"tags":[22,3,5,6],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS? - The Workfall Blog<\/title>\n<meta name=\"description\" content=\"Queues are a great way to mix and match software structures. Amazon\u2019s version of queues is called Amazon SQS or Simple Queue Service.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS? - The Workfall Blog\" \/>\n<meta property=\"og:description\" content=\"Queues are a great way to mix and match software structures. Amazon\u2019s version of queues is called Amazon SQS or Simple Queue Service.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/\" \/>\n<meta property=\"og:site_name\" content=\"The Workfall Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/workfall\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-23T11:10:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-22T08:15:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@workfall\" \/>\n<meta name=\"twitter:site\" content=\"@workfall\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Workfall\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#organization\",\"name\":\"Workfall - Hire #Kickass Coders On Demand\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/workfall\/\",\"https:\/\/www.linkedin.com\/company\/workfall\/\",\"https:\/\/facebook.com\/workfall\",\"https:\/\/twitter.com\/workfall\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"contentUrl\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"width\":400,\"height\":400,\"caption\":\"Workfall - Hire #Kickass Coders On Demand\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#website\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/\",\"name\":\"The Workfall Blog\",\"description\":\"#Tech #Remote #Jobs\",\"publisher\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learning.workfall.com\/learning\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#primaryimage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png\",\"width\":1200,\"height\":628,\"caption\":\"Orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#webpage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/\",\"name\":\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS? - The Workfall Blog\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#primaryimage\"},\"datePublished\":\"2021-10-23T11:10:52+00:00\",\"dateModified\":\"2025-08-22T08:15:50+00:00\",\"description\":\"Queues are a great way to mix and match software structures. Amazon\u2019s version of queues is called Amazon SQS or Simple Queue Service.\",\"breadcrumb\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learning.workfall.com\/learning\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#webpage\"},\"author\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\"},\"headline\":\"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?\",\"datePublished\":\"2021-10-23T11:10:52+00:00\",\"dateModified\":\"2025-08-22T08:15:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#webpage\"},\"wordCount\":1683,\"publisher\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png\",\"keywords\":[\"amazon sqs\",\"AWS\",\"AWS Step Functions\",\"workfall\"],\"articleSection\":[\"AWS Cloud Computing\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\",\"name\":\"Workfall\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"caption\":\"Workfall\"},\"sameAs\":[\"https:\/\/www.workfall.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS? - The Workfall Blog","description":"Queues are a great way to mix and match software structures. Amazon\u2019s version of queues is called Amazon SQS or Simple Queue Service.","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:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/","og_locale":"en_US","og_type":"article","og_title":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS? - The Workfall Blog","og_description":"Queues are a great way to mix and match software structures. Amazon\u2019s version of queues is called Amazon SQS or Simple Queue Service.","og_url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/","og_site_name":"The Workfall Blog","article_publisher":"https:\/\/facebook.com\/workfall","article_published_time":"2021-10-23T11:10:52+00:00","article_modified_time":"2025-08-22T08:15:50+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@workfall","twitter_site":"@workfall","twitter_misc":{"Written by":"Workfall","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#organization","name":"Workfall - Hire #Kickass Coders On Demand","url":"https:\/\/learning.workfall.com\/learning\/blog\/","sameAs":["https:\/\/www.instagram.com\/workfall\/","https:\/\/www.linkedin.com\/company\/workfall\/","https:\/\/facebook.com\/workfall","https:\/\/twitter.com\/workfall"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","contentUrl":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","width":400,"height":400,"caption":"Workfall - Hire #Kickass Coders On Demand"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#website","url":"https:\/\/learning.workfall.com\/learning\/blog\/","name":"The Workfall Blog","description":"#Tech #Remote #Jobs","publisher":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learning.workfall.com\/learning\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#primaryimage","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png","width":1200,"height":628,"caption":"Orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS"},{"@type":"WebPage","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#webpage","url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/","name":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS? - The Workfall Blog","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#primaryimage"},"datePublished":"2021-10-23T11:10:52+00:00","dateModified":"2025-08-22T08:15:50+00:00","description":"Queues are a great way to mix and match software structures. Amazon\u2019s version of queues is called Amazon SQS or Simple Queue Service.","breadcrumb":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learning.workfall.com\/learning\/blog\/"},{"@type":"ListItem","position":2,"name":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?"}]},{"@type":"Article","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#article","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#webpage"},"author":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a"},"headline":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS?","datePublished":"2021-10-23T11:10:52+00:00","dateModified":"2025-08-22T08:15:50+00:00","mainEntityOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#webpage"},"wordCount":1683,"publisher":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#organization"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqs\/#primaryimage"},"thumbnailUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png","keywords":["amazon sqs","AWS","AWS Step Functions","workfall"],"articleSection":["AWS Cloud Computing"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a","name":"Workfall","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/image\/","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","caption":"Workfall"},"sameAs":["https:\/\/www.workfall.com"]}]}},"jetpack_featured_media_url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/10\/33.png","jetpack-related-posts":[{"id":626,"url":"https:\/\/learning.workfall.com\/learning\/blog\/orchestrate-queue-based-microservices-with-aws-step-functions-and-amazon-sqspart1\/","url_meta":{"origin":8,"position":0},"title":"How to orchestrate Queue-based Microservices with AWS Step Functions and Amazon SQS (Part 1)?","date":"November 11, 2021","format":false,"excerpt":"Assume that you are developing a distributed application and looking for a solution to transmit a large volume of data, at any level of throughput, without losing messages or requiring other services to be available, you can think about Amazon SQS! Using Amazon SQS you can decouple application components so\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"Orchestrate Queue based Microservices - Amazon SQS","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/CoverImages_1200x628px-3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":520,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-build-a-serverless-workflow-with-aws-step-functions-part-1\/","url_meta":{"origin":8,"position":1},"title":"How to build a Serverless Workflow with AWS Step Functions (Part 1)?","date":"November 10, 2021","format":false,"excerpt":"AWS Step Functions is a serverless orchestration solution that enables you to effortlessly coordinate several Lambda functions into customizable workflows that are simple to debug and modify. To see the full implementation of How to Build a Serverless Workflow with AWS Step Functions, refer to part 2 of the blog\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS Step Functions - Workfall","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/StepFunction01.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2374,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-use-kafka-for-event-streaming-in-a-microservices-architecture\/","url_meta":{"origin":8,"position":2},"title":"How to Use Kafka for Event Streaming in a Microservices Architecture?","date":"June 27, 2023","format":false,"excerpt":"The world of creating real-time applications can get complex when we have to consider latency, fault tolerance, scalability, and possible data losses. Traditionally, web sockets were the go-to option when it came to real-time applications, but think of a situation whereby there\u2019s server downtime. It means that there is a\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Kafka for Event Streaming in a Microservices Architecture","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/06\/Cover-Images_Part2-1-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1083,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-deploy-nestjs-microservices\/","url_meta":{"origin":8,"position":3},"title":"How to Deploy NestJS Microservices to AWS Elastic Beanstalk?","date":"July 26, 2022","format":false,"excerpt":"AWS Elastic Beanstalk is an AWS service on which you can deploy your application and it offers orchestration for various AWS services such as EC2, and S3 out of the box through auto-scaling, load-balancing, and capacity provisioning. All you have to do is upload your code and AWS Elastic Beanstalk\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to Deploy NestJS Microservices to AWS Elastic Beanstalk?","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1066,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/","url_meta":{"origin":8,"position":4},"title":"Architect NestJS Microservices with AWS Elastic Beanstalk","date":"July 19, 2022","format":false,"excerpt":"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments effectively. On the other hand, NestJS is popular in creating efficient and scalable server-side applications, and is relatively a new option for the backend framework - it is lightweight,\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Architect NestJS Microservices with AWS Elastic Beanstalk","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":492,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-set-up-aws-copilot-to-build-release-and-operate-containerized-applications-on-ecs-and-fargate-using-a-cli-2\/","url_meta":{"origin":8,"position":5},"title":"How to set up AWS Copilot to build, release and operate containerized applications on ECS and Fargate using a CLI?","date":"November 10, 2021","format":false,"excerpt":"Are you completely drained by worrying about your infrastructure over architecture? Well, AWS Copilot supercharges your application by allowing you to set up infrastructure, build your application with many microservices, set up a pipeline to automate release and monitor the stack and application's status, and add-ons all from a single\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS Copilot - Workfall","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/copilot1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/8"}],"collection":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":26,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"predecessor-version":[{"id":2263,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/8\/revisions\/2263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media\/274"}],"wp:attachment":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}