split actions or not? | Community
Skip to main content
Urs_Boller
Community Advisor
Community Advisor
August 21, 2020
Solved

split actions or not?

  • August 21, 2020
  • 8 replies
  • 3055 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Urs_Boller

Really good answer from @duynguyen_adobe, 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'

 

8 replies

Level 2
August 24, 2020
@urs_boller, How about use of https://github.com/adobe/aio-lib-state as a temporary storage, we are planning something similar.
Urs_Boller
Community Advisor
Community Advisor
August 24, 2020
@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?
Level 2
August 24, 2020
hi @urs_boller, the doc says we can do the chaining of actions, but we have not tried yet.
Urs_Boller
Community Advisor
Community Advisor
August 24, 2020

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

Adobe Employee
August 24, 2020

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#sequences

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

sequences: authenticate: actions: 'login, check, redirect' web: 'yes'
Urs_Boller
Community Advisor
Community Advisor
August 24, 2020
@duynguyen_adobe thanks for the hint with sequences. Assume I have such a sequence, how do I pass data from one action to the other?
Adobe Employee
August 24, 2020
@urs_boller, 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.
Urs_Boller
Community Advisor
Urs_BollerCommunity AdvisorAuthorAccepted solution
Community Advisor
August 24, 2020

Really good answer from @duynguyen_adobe, 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'