conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Passing data between steps?

Open StefanS998 opened this issue 5 years ago • 5 comments

Hi, I'm beginner and I'd like to ask a question. Whether there is a way to send data from one step to another? For example, in one step I do HttpRequest and I get JSON record. I want to pass JSON data to next step, and do some kind of data manipulation inside workflow, without REST service. Is this possible? Gratefully, Stefan

StefanS998 avatar Aug 13 '20 18:08 StefanS998

I second this, although I wouldn't use the http request example as ResponseCode:step.ResponseCode and ResponseBody:step.ResponseBody take care of piping outputs.

What about a situation where I have multiple Activities? How do I uniquely log the Activity results for later retrieval?

What about custom data inputs, how do I reference them without assigning a new variable name to each custom input?

How do I assign them as the output of any given step for reuse in later steps?

We may need some sort of binding structure here where all custom data inputs are enumerated and/or indexed and that object is referencable with a few methods. Something like a dict or JSON object.

On Thu, Aug 13, 2020, 1:14 PM StefanS998 [email protected] wrote:

Hi, I'm beginner and I'd like to ask a question. Whether there is a way to send data from one step to another? For example, in one step I do HttpRequest and I get JSON record. I want to pass JSON data to next step, and do some kind of data manipulation inside workflow, without REST service. Is this possible? Gratefully, Stefan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danielgerlag/conductor/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSPVKVU7A7OBC7E5WFQBFTSAQUO5ANCNFSM4P6WWGEA .

OluAgunloye avatar Aug 13 '20 18:08 OluAgunloye

Bumping this. @danielgerlag Are we missing something here?

OluAgunloye avatar Sep 09 '20 21:09 OluAgunloye

You can map the outputs of any step to fields on the data context of your workflow instance, and then map those fields back into inputs of other steps. see https://conductor-core.readthedocs.io/en/latest/primitives/

danielgerlag avatar Sep 10 '20 02:09 danielgerlag

@danielgerlag So I don't have to use "ActivityResult" as the field name? I think I've tried this and other fields didn't work so I assumed it was a reserved name. In any case, let me try again because that would indeed be very helpful. Thanks again for your help!

OluAgunloye avatar Sep 21 '20 13:09 OluAgunloye

@StefanS998 Close this when you get the chance, Daniel's answer is correct. You just change the key name from its default (i.e. ActivityResult or EventData) to something without a decimal/period (or you'll run into BSON Serialization Errors).

OluAgunloye avatar Sep 24 '20 01:09 OluAgunloye