Iyad Abilmona
Iyad Abilmona

Reputation: 1

How to trigger AWS SWF from another application

I'm new to SWF and I'm trying to write a workflow to use from my application. I was able to successfully write the workflow, deploy it and run it using the AWS SDK. The workflow communicates with my application using lambda functions to call APIs in the application. My question is how to trigger the workflow workers from the application using APIs.

So far I was able to successfully start an execution using SimpleWorkflowService.StartWorkflowExecution API call which schedules a decision task but does not go any further. My question is how do I trigger the workers using the API to start the execution, basically triggering this code in my main function:

ActivityWorker aw = new ActivityWorker(service, domain, taskListToPoll);
 aw.addActivitiesImplementation(new GreeterActivitiesImpl());
 aw.start();

 WorkflowWorker wfw = new WorkflowWorker(service, domain, taskListToPoll);
 wfw.addWorkflowImplementationType(GreeterWorkflowImpl.class);
 wfw.start();

I tried using SimpleWorkflowService.PollForDecisionTask which starts the decision task but stops there.

Upvotes: 0

Views: 241

Answers (1)

Maxim Fateev
Maxim Fateev

Reputation: 6890

SWF Workers have to be always running. There is no way to trigger them. Think about them as queue consumers. There is no way to trigger an SQS consumer, for example. It is expected to be managed and started by application code.

Upvotes: 1

Related Questions