aws step function invoke with token functionality for invoking aws personalize batch segment job

0

We want to trigger the aws personalize item attribute affinity user segment batch job from our application. We are planning to use step function to trigger the batch segment. The batch segment job is asynchronous job, the job might take more time to complete. Can we use step functions invoke with "Wait for a Callback with the Task Token" functionality to trigger batch segment job ? So that we don't need to implement the wait/sleep and awage/check loop.

Or is there any other way to check the job status without being in a wait-sleep cycle ?

已提問 1 年前檢視次數 246 次
1 個回答
0
已接受的答案

Not sure what exactly you are asking. If the API you are calling is synchronous, i.e., it blocks until the operation is done and when it returns, you get the answer, there is nothing special you need to do.

If however, the operation is asynchronous, i.e., you get a job ID, you will need to poll for the response by getting into a look that gets the status of the job, checks for completion, and if it did not complete yet, wait a few seconds/minutes and go back.

Specifically with Personalize, if you refer to the create_batch_segment_job, it is asynchrouns, you will need to call describe_batch_segment_job in a loop to get the latest status.

There are a few services that have optimized integrations with Step Functions. With these services you can call the API using .sync in the resource name, and Step Functions will do the loop for you. Personalize is not one of these services.

You also mentioned a token. I am not sure exactly to which token you are refering to. If you are refering to the Wait for task token integration type, you will need someone to call the completion API, and Personalize does't know how to do it.

profile pictureAWS
專家
Uri
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南