[{"data":1,"prerenderedAt":97},["ShallowReactive",2],{"content-svc-step-functions-guides-integrating-step-functions-with-containerized-workloads-20-patterns":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":13,"menu":14,"menuType":94,"isCollapseableMenu":17,"nextDocItem":33,"previousDocItem":19,"contributorPaths":95,"contentName":16,"slug":32,"readingTime":29},"\u003Cp>Service integration patterns are the foundational mechanisms through which Step Functions integrates with AWS services. This chapter gives you a basic understanding of available service integration patterns and different ways Step Functions integrates with AWS services.\u003C\u002Fp>\n\u003Ch4> Service Integration patterns \u003C\u002Fh4>\n\n\u003Cp>\u003Cstrong>Request Response\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>\u003Ccode>Request Response\u003C\u002Fcode> integration calls an API of a service and lets Step Functions progress to the next state immediately after it gets the HTTP response. Popular integrations include invoking Amazon Lambda functions, sending an Amazon EventBridge events, and sending a message to an Amazon SQS queue. You can learn more about \u003Ccode>Request Response\u003C\u002Fcode> pattern \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-default\">here\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Run a Job (.sync)\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>\u003Ccode>Run a Job\u003C\u002Fcode> integration calls an API of a service and waits for the job behind the API to complete. For instance, when submitting an AWS Batch job using \u003Ccode>Run a Job\u003C\u002Fcode> integration, the Step Functions task waits for the batch job to complete before moving to the downstream tasks. Popular integrations include submitting an AWS Batch SubmitJob, AWS Glue StartJobRun and Amazon ECS RunTask. You can learn more about \u003Ccode>Run a Job\u003C\u002Fcode> pattern \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-sync\">here\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Wait for a Callback with a task token\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>\u003Ccode>Wait for a Callback\u003C\u002Fcode> integration calls an API of a service with a special token and then pauses the workflow until the task token is returned. This integration is widely used for use cases that involves human approval process and external systems. You can learn more about \u003Ccode>Wait for a Callback with a task token\u003C\u002Fcode> pattern \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-wait-token\">here\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch4>AWS Service integrations\u003C\u002Fh4>\n\n\u003Cp>\u003Cstrong>AWS SDK service integrations\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>You can use Step Functions&#39; \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fsupported-services-awssdk.html\">AWS SDK integrations\u003C\u002Fa> to call almost any AWS service API actions from your state machine.  Recently released services may not have SDK integrations available until a later update. SDK service integrations can use either \u003Ccode>Request Response\u003C\u002Fcode> or \u003Ccode>Wait for a Callback\u003C\u002Fcode> pattern. \u003Ccode>Run a Job\u003C\u002Fcode> integrations is available only with optimized integrations. You can use SDK service integrations to read an Amazon S3 Object, start an AWS Athena query, or call almost any AWS service APIs.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Optimized integrations\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-supported-services.html\">Optimized integrations\u003C\u002Fa> are available for a subset of services such as AWS Lambda, AWS Batch, and Amazon ECS\u002FAWS Fargate. All three service integration patterns are applicable to optimized integrations. To see the full list of services supported by optimized integrations, visit the \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-supported-services.html\">documentation\u003C\u002Fa>. \u003C\u002Fp>\n\u003Cp>To learn more about the integration patterns, visit the \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html\">documentation\u003C\u002Fa>\u003C\u002Fp>\n",{"title":6,"order":7,"resources":8},"Service Integration patterns and AWS service integrations ",20,[9],{"link":10,"text":11,"type":12},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html","Service integration patterns","documentation","Service integration patterns are the foundational mechanisms through which Step Functions integrates with AWS services. This chapter gives you a basic understanding of available service integration patterns and different ways Step Functions integrates with AWS services.\n\n\u003Ch4> Service Integration patterns \u003C\u002Fh4>\n\n**Request Response**\n\n`Request Response` integration calls an API of a service and lets Step Functions progress to the next state immediately after it gets the HTTP response. Popular integrations include invoking Amazon Lambda functions, sending an Amazon EventBridge events, and sending a message to an Amazon SQS queue. You can learn more about `Request Response` pattern [here](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-default).\n\n**Run a Job (.sync)**\n\n`Run a Job` integration calls an API of a service and waits for the job behind the API to complete. For instance, when submitting an AWS Batch job using `Run a Job` integration, the Step Functions task waits for the batch job to complete before moving to the downstream tasks. Popular integrations include submitting an AWS Batch SubmitJob, AWS Glue StartJobRun and Amazon ECS RunTask. You can learn more about `Run a Job` pattern [here](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-sync).\n\n**Wait for a Callback with a task token**\n\n`Wait for a Callback` integration calls an API of a service with a special token and then pauses the workflow until the task token is returned. This integration is widely used for use cases that involves human approval process and external systems. You can learn more about `Wait for a Callback with a task token` pattern [here](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-wait-token).\n\n\n\u003Ch4>AWS Service integrations\u003C\u002Fh4>\n\n**AWS SDK service integrations**\n\nYou can use Step Functions' [AWS SDK integrations](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fsupported-services-awssdk.html) to call almost any AWS service API actions from your state machine.  Recently released services may not have SDK integrations available until a later update. SDK service integrations can use either `Request Response` or `Wait for a Callback` pattern. `Run a Job` integrations is available only with optimized integrations. You can use SDK service integrations to read an Amazon S3 Object, start an AWS Athena query, or call almost any AWS service APIs.\n\n**Optimized integrations**\n\n[Optimized integrations](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-supported-services.html) are available for a subset of services such as AWS Lambda, AWS Batch, and Amazon ECS\u002FAWS Fargate. All three service integration patterns are applicable to optimized integrations. To see the full list of services supported by optimized integrations, visit the [documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-supported-services.html). \n\n\nTo learn more about the integration patterns, visit the [documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html)\n",[15],{"title":16,"collapsible":17,"isCollapsed":17,"content":18},"Integrating Step Functions with containerized workloads",false,[19,26,33,46,59,73,89],{"title":20,"order":21,"time":22,"path":23,"id":24,"link":25},"Introduction",10,"1 min","10-introduction","10-introduction.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F10-introduction",{"title":6,"order":7,"resources":27,"time":29,"path":30,"id":31,"link":32},[28],{"link":10,"text":11,"type":12},"2 min","20-patterns","20-patterns.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F20-patterns",{"title":34,"order":35,"resources":36,"time":22,"path":43,"id":44,"link":45},"Connecting to systems outside AWS",40,[37,40],{"link":38,"text":39,"type":12},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-third-party-apis.html","Third party API integration",{"link":41,"text":42,"type":12},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconcepts-activities.html","Activity Integration","40-external-system-integration","40-external-system-integration.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F40-external-system-integration",{"title":47,"order":48,"resources":49,"time":29,"path":56,"id":57,"link":58},"Run a job Integration",50,[50,53],{"link":51,"text":52,"type":12},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-ecs.html","Manage Amazon ECS or Fargate Tasks with Step Functions",{"link":54,"text":55,"type":12},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-eks.html","Call Amazon EKS with Step Functions","50-run-a-job","50-run-a-job.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F50-run-a-job",{"title":60,"order":61,"callout":62,"resources":65,"time":29,"path":70,"id":71,"link":72},"Wait for Callback integration",60,{"title":63,"description":63,"link":64},"Parallel video processing using AWS Fargate tasks","https:\u002F\u002Fcatalog.workshops.aws\u002Fstepfunctions\u002Fen-US\u002Fuse-cases\u002Fdata-processing\u002Fmap-ecs",[66],{"link":67,"text":68,"type":69},"https:\u002F\u002Fserverlessland.com\u002Fpatterns\u002Fsfn-ecs-sam","Sample pattern for Wait for Callback","pattern","60-callback","60-callback.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F60-callback",{"title":42,"order":74,"resources":75,"callout":82,"time":29,"path":86,"id":87,"link":88},70,[76,78],{"link":41,"text":77,"type":12},"Activities",{"link":79,"text":80,"type":81},"https:\u002F\u002Fcatalog.us-east-1.prod.workshops.aws\u002Fworkshops\u002F2a22e604-2f2e-4d7b-85a8-33b38c999234\u002Fen-US\u002Fuse-cases\u002Fmonte-carlo-simulation","Run Monte Carlo Simulation with AWS Fargate and Step Functions Activity","workshop",{"title":83,"description":84,"link":85},"Using Activities with AWS Fargate","This blog post demostrates how you can use Activities with AWS Fargate at scale.","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcontainers\u002Frun-monte-carlo-simulations-at-scale-with-aws-step-functions-and-aws-fargate\u002F","70-activity","70-activity.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F70-activity",{"title":90,"order":21,"time":22,"path":91,"id":92,"link":93},"Conclusion","80-conclusion","80-conclusion.md","\u002Fcontent\u002Fservice\u002Fstep-functions\u002Fguides\u002Fintegrating-step-functions-with-containerized-workloads\u002F80-conclusion","LIST",[96],"content\u002Fcontributors\u002Fuma-ramadoss.json",1792578874796]