Hi All,
I have created an Adobe IO runtime project having 3 actions. (action1, action2, action3)
From action1, based on certain condition, I need to call action3. Is ti possible? If possible, how to call the action?
cc @arunpatidar @AMANATH_ULLAH @sarav_prakash @mk_aem21 @AmitVishwakarma
Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
Correct. Treat actions as microservices. Similar to AWS lambda or Cloudflare worker or Azure functions.
You write single action performing a business task. The task can have conditions, business logic, transformations, all goes inside the single action.
Here is my runtime action
Its single action starting from index.mjs. Conditionally I call contentfragment or folder or asset functions. And token, journals are housekeeping. But overall is a single runtime action, performing different tasks based of conditions in index.mjs
Have 1 more query here.
My Adobe IO runtime has 3 actions.
https://123456-pocservice-abcd.adobeioruntime.net/api/v1/web/myProject/action-1
https://123456-pocservice-abcd.adobeioruntime.net/api/v1/web/myProject/action-2
https://123456-pocservice-abcd.adobeioruntime.net/api/v1/web/myProject/action-3
Views
Replies
Total Likes
Dont create 3 actions. Instead create single callable action and write action1 condition and action2,3 executions as functions inside single action.
So your action needs to be either webaction, thats callable from UI like hit of some button. OR can be non-webaction as whisk alarm job, running at cron schedule.
I understand you want to perform 1 task, conditionally. And so build as single action, and split into functions.
Hi @sarav_prakash Thanks for your help.
So, As per your statements, I should not call an action from other action. Instead, In action1 only, based on condition, call the functions(or the utility code).
Views
Replies
Total Likes
Correct. Treat actions as microservices. Similar to AWS lambda or Cloudflare worker or Azure functions.
You write single action performing a business task. The task can have conditions, business logic, transformations, all goes inside the single action.
Here is my runtime action
Its single action starting from index.mjs. Conditionally I call contentfragment or folder or asset functions. And token, journals are housekeeping. But overall is a single runtime action, performing different tasks based of conditions in index.mjs
Views
Likes
Replies