Movatterモバイル変換


[0]ホーム

URL:


What is Step Functions? - AWS Step Functions
DocumentationAWS Step FunctionsDeveloper Guide
Standard and Express workflows typesIntegrating with other servicesExample use cases for workflows

What is Step Functions?

With AWS Step Functions, you can create workflows, also calledState machines, to build distributed applications, automate processes, orchestrate microservices, and create data and machine learning pipelines.

Step Functions is based onstate machines andtasks. In Step Functions, state machines are calledworkflows, which are a series of event-driven steps. Each step in a workflow is called astate. For example, aTask state represents a unit of work that another AWS service performs, such as calling another AWS service or API. Instances of running workflows performing tasks are calledexecutions in Step Functions.

The work in your state machine tasks can also be done usingActivities which are workers that exist outside of Step Functions.

Illustrative example of a Step Functions workflow diagram.

In the Step Functions' console, you canvisualize, edit, and debug your application’s workflow. You can examine the state of each step in your workflow to make sure that your application runs in order and as expected.

Depending on your use case, you can have Step Functions call AWS services, such as Lambda, to perform tasks. You can have Step Functions control AWS services, such as AWS Glue, to create extract, transform, and load workflows. You also can create long-running, automated workflows for applications that require human interaction.

For a complete list of AWS Regions where Step Functions is available, see theAWS Region Table.

Start with theGetting started tutorial in this guide. For advanced topics and use cases, see the modules inThe Step Functions Workshop.

Standard and Express workflows types

Step Functions has two workflow types:

  • Standard workflows are ideal for long-running, auditable workflows, as they show execution history and visual debugging.

    Standard workflows haveexactly-once workflow execution and can run for up toone year. This means that each step in a Standard workflow will execute exactly once.

  • Express workflows are ideal for high-event-rate workloads, such as streaming data processing and IoT data ingestion.

    Express workflows haveat-least-once workflow execution and can run for up tofive minutes. This means that one or more steps in an Express Workflow can potentially run more than once, while each step in the workflow executes at least once.

Standard workflowsExpress workflows
2,000 per second execution rate100,000 per second execution rate
4,000 per second state transition rateNearly unlimited state transition rate
Priced by state transitionPriced by number and duration of executions
Show execution history and visual debuggingShow execution history and visual debugging based onlog level
See execution history in Step Functions

Send execution history toCloudWatch

Support integrations with all services.

Support optimized integrations with some services.

Support integrations with all services.
SupportRequest Response pattern for all services

SupportRun a Job and/orWait for Callback patterns in specific services (see following section for details)

SupportRequest Responsepattern for all services

For more information on Step Functions pricing and choosing workflow type, see the following:

Integrating with other services

Step Functions integrates with multiple AWS services. To call other AWS services, you can use two integration types:

  • AWS SDK integrations provide a way to call any AWS service directly from your state machine, giving you access to thousands of API actions.

  • Optimized integrations provide custom options for using those services in your state machines.

To combine Step Functions with other services, there are threeservice integration patterns:

Standard Workflows and Express Workflows support the sameintegrations but not the sameintegration patterns.

  • Standard Workflows supportRequest Response integrations. Certain services supportRun a Job (.sync), orWait for Callback (.waitForTaskToken) , and both in some cases. See the following optimized integrations table for details.

  • Express Workflows only supportRequest Response integrations.

To help decide between the two types, seeChoosing workflow type in Step Functions.

AWS SDK integrations in Step Functions

Integrated serviceRequest ResponseRun a Job -.syncWait for Callback -.waitForTaskToken
Over two hundred servicesStandard & ExpressNot supportedStandard

Optimized integrations in Step Functions

Integrated serviceRequest ResponseRun a Job -.syncWait for Callback -.waitForTaskToken
Amazon API GatewayStandard & ExpressNot supportedStandard
Amazon AthenaStandard & ExpressStandardNot supported
AWS BatchStandard & ExpressStandardNot supported
Amazon BedrockStandard & ExpressStandardStandard
AWS CodeBuildStandard & ExpressStandardNot supported
Amazon DynamoDBStandard & ExpressNot supportedNot supported
Amazon ECS/FargateStandard & ExpressStandardStandard
Amazon EKSStandard & ExpressStandardStandard
Amazon EMRStandard & ExpressStandardNot supported
Amazon EMR on EKSStandard & ExpressStandardNot supported
Amazon EMR ServerlessStandard & ExpressStandardNot supported
Amazon EventBridgeStandard & ExpressNot supportedStandard
AWS GlueStandard & ExpressStandardNot supported
AWS Glue DataBrewStandard & ExpressStandardNot supported
AWS LambdaStandard & ExpressNot supportedStandard
AWS Elemental MediaConvertStandard & ExpressStandardNot supported
Amazon SageMaker AIStandard & ExpressStandardNot supported
Amazon SNSStandard & ExpressNot supportedStandard
Amazon SQSStandard & ExpressNot supportedStandard
AWS Step FunctionsStandard & ExpressStandardStandard

Example use cases for workflows

Step Functions manages your application's components and logic, so you can write less code and focus on building and updating your application quickly. The following image shows six use cases for Step Functions workflows.

Visual examples of six common workflow use cases, described in the following text.

  1. Orchestrate tasks – You can create workflows that orchestrate a series of tasks, orsteps, in a specific order. For example,Task A might be a Lambda function which provides inputs for another Lambda function inTask B. The last step in your workflow provides the final result.

  2. Choose tasks based on data – Using aChoice state, you can have Step Functions make decisions based on the state’s input. For example, imagine that a customer requests a credit limit increase. If the request is more than your customer’s pre-approved credit limit, you can have Step Functions send your customer's request to a manager for sign-off. If the request is less than your customer’s pre-approved credit limit, you can have Step Functions approve the request automatically.

  3. Error handling(Retry /Catch) – You can retry failed tasks, or catch failed tasks and automatically run alternative steps.

    For example, after a customer requests a username, perhaps the first call to your validation service fails, so your workflow may retry the request. When the second request is successful, the workflow can proceed.

    Or, perhaps the customer requested a username that is invalid or unavailable, aCatch statement could lead to a Step Functions workflow step that suggests an alternative username.

    For examples ofRetry andCatch, seeHandling errors in Step Functions workflows.

  4. Human in the loop – Step Functions can include human approval steps in the workflow. For example, imagine a banking customer attempts to send funds to a friend. Witha callback and a task token, you can have Step Functions wait until the customers friend confirms the transfer, and then Step Functions will continue the workflow to notify the banking customer that the transfer has completed.

    For an example, seeCreate a callback pattern example with Amazon SQS, Amazon SNS, and Lambda.

  5. Process data in parallel steps – Using aParallel state, Step Functions can process input data in parallel steps. For example, a customer might need to convert a video file into several display resolutions, so viewers can watch the video on multiple devices. Your workflow could send the original video file to several Lambda functions or use the optimized AWS Elemental MediaConvert integration to process a video into multiple display resolutions at the same time.

  6. Dynamically process data elements – Using aMap state, Step Functions can run a set of workflow steps on each item in a dataset. The iterations run in parallel, which makes it possible to process a dataset quickly. For example, when your customer orders thirty items, your system needs to apply the same workflow to prepare each item for delivery. After all items have been gathered and packaged for delivery, the next step might be to quickly send your customer a confirmation email with tracking information.

    For an examplestarter template, seeProcess data with a Map.


[8]
ページ先頭

©2009-2025 Movatter.jp