Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

split actions or not?

ursboller
Community Advisor
Community Advisor

Working on an app with following steps

1) fetch data from external API

2) write data to Adobe Analytics

 

currently I only have one action that both makes the fetch request and later the push data request. but I think it might be better to have 2 seperate actions, one for the data fetch and the other for the push data. basically passing data to second action (temp storage?) and second actions makes the data push.

this way I might re-use the second action for other data pushes later on - just handing over data and some parameters for the data push and done.

 

but I could as well write modules that are included in the single actions and re-use those for other actions.

 

any feedback what is the better approach? having a single "workflow" approach (get data and push) in one action or separate? if separate, any tips how to hand over the data?

1 Accepted Solution
ursboller
Correct answer by
Community Advisor
Community Advisor

Really good answer from @duypnguyen, unfortunatelly as a comment so I can't mark it as answer - Copy comment her to mark as answer:

 



Good discussions over here. Chaining of action in I/O Runtime (or Openwhisk at its core) is called sequence, which you can read more about here: https://github.com/AdobeDocs/adobeio-runtime/blob/master/reference/sequences_compositions.md#sequenc...

Example of sequence definition in the manifest.yml of a Firefly project:
sequences:
  authenticate:
    actions: 'login, check, redirect'
    web: 'yes'

 

View solution in original post

8 Replies
eldhov19157560
Level 3
Level 3
@ursboller, How about use of https://github.com/adobe/aio-lib-state as a temporary storage, we are planning something similar.
ursboller
Community Advisor
Community Advisor
@eldhov19157560 ok, I can temp store the data. but question is: do I write one or two actions? if there are two actions, how do I trigger the second action from within the first action?
eldhov19157560
Level 3
Level 3
hi @ursboller, the doc says we can do the chaining of actions, but we have not tried yet.
ursboller
Community Advisor
Community Advisor

@eldhov19157560 do you have a link for the action chaining?

duypnguyen
Employee
Employee

Good discussions over here. Chaining of action in I/O Runtime (or Openwhisk at its core) is called sequence, which you can read more about here: https://github.com/AdobeDocs/adobeio-runtime/blob/master/reference/sequences_compositions.md#sequenc...

Example of sequence definition in the manifest.yml of a Firefly project:

sequences:
  authenticate:
    actions: 'login, check, redirect'
    web: 'yes'
ursboller
Community Advisor
Community Advisor
@duypnguyen thanks for the hint with sequences. Assume I have such a sequence, how do I pass data from one action to the other?
duypnguyen
Employee
Employee
@ursboller, the returned payload of your first action would be in the input params of your second, and so on. The returned output of the last action in the sequence would be its response payload in the end.
ursboller
Correct answer by
Community Advisor
Community Advisor

Really good answer from @duypnguyen, unfortunatelly as a comment so I can't mark it as answer - Copy comment her to mark as answer:

 



Good discussions over here. Chaining of action in I/O Runtime (or Openwhisk at its core) is called sequence, which you can read more about here: https://github.com/AdobeDocs/adobeio-runtime/blob/master/reference/sequences_compositions.md#sequenc...

Example of sequence definition in the manifest.yml of a Firefly project:
sequences:
  authenticate:
    actions: 'login, check, redirect'
    web: 'yes'

 

View solution in original post