goosefraba
goosefraba

Reputation: 251

Difference between activites and the new callback-pattern feature in AWS Step Functions

AWS released a new feature for AWS Step Functions (Callback Pattern):

https://aws.amazon.com/about-aws/whats-new/2019/05/aws-step-functions-support-callback-patterns/

I wonder now, what's actually the difference to the already existing activities.

Let me sum that up for you:

What is the difference to the newly announced callback pattern? In my eyes, it is actually totally the same - do I miss something?

Upvotes: 3

Views: 1869

Answers (1)

Andy Katz
Andy Katz

Reputation: 86

Activities are poll-based and the callback pattern is push-based. Both let you manage asynchronous tasks.

In an activity task, Step Functions waits for a worker to poll using GetActivityTask. When a match is made, Step Functions returns the state payload and a task token to the worker that made the request. This is useful, for example, when your workers reside in a datacenter. You have less network configuration to poll from the datacenter instead of opening VPN access.

In the callback pattern, Step Functions pushes the payload and task token to a supported AWS service integration (Lambda, Fargate, ECS, SNS, and SQS). This is useful in serverless architectures, which tend to favor ephemeral compute and event-driven data flows. The task token may be delegated to other services before returning to Step Functions, too.

Both require a worker to eventually return a result payload and the task token to Step Functions to advance the state machine to the next step.

Upvotes: 7

Related Questions