Expand my Community achievements bar.

SOLVED

Calling an Adobe I/O Runtime action from other action

Avatar

Level 9

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.

1 Accepted Solution

Avatar

Correct answer by
Level 8

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 

sarav_prakash_0-1738860108285.png

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

 

 

View solution in original post

4 Replies

Avatar

Level 9

Avatar

Level 8

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. 

Avatar

Level 9

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).

 

 

 

Avatar

Correct answer by
Level 8

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 

sarav_prakash_0-1738860108285.png

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