How to Add Values Dynamically in Pipedream Flow and Run It Manually?

This topic was automatically generated from Slack. You can find the original thread here.

Hellos! I’m learning how to use Pipedream and could use some help.
Is there a way for me to add values as part of the flow and then use those values dynamically later in the flow? This way, I don’t have a trigger, but I’d just add the values at the top and run the flow manually and it does what I need. Let me know. Thanks! :slightly_smiling_face:

Hey Nizar, let’s see how our support bot, Pi, does with this question

Hellos! I’m learning how to use Pipedream and could use some help.
Is there a way for me to add values as part of the flow and then use those values dynamically later in the flow? This way, I don’t have a trigger, but I’d just add the values at the top and run the flow manually and it does what I need. Let me know. Thanks!

Yes, you can add values as part of your flow and use them later in the flow. You can use the “Manual” trigger to run the flow manually. To add values, you can create a code step and define the values you want to use. Then, you can reference these values in subsequent steps of your flow. Here’s an example: 1. Create a new workflow with a “Manual” trigger. 2. Add a “Code” step and define your values like this: export default defineComponent({ async run({ steps, $ }) { const value1 = "example value 1"; const value2 = "example value 2"; return { value1, value2 }; }, }); 3. In the next steps of your flow, you can access these values using steps.<code_step_name>.return_value.value1 and steps.<code_step_name>.return_value.value2, where <code_step_name> is the name you assigned to the code step in step 2. Remember to replace <code_step_name> with the actual name of your code step.

That’s a good response, with the exception of the “Manual” trigger. That part is slightly misleading, but the rest is accurate. You can also use a pre-built action to do this: https://pipedream.com/apps/helper-functions/actions/export-variables

Helper fn is just what I was looking for, thanks so much! :slightly_smiling_face:

It could be nice to have something like that as an actual trigger, so that we can run a workflow manually with different values, directly from the Pipedream UI (without having to edit the workflow each time in order to update those values).

Otherwise, we need to have some kind of external UI to trigger the workflows via HTTP trigger (with various parameters).

We’re planning to build a Slack Bot to do just that… but directly in the Pipedream UI would be much easier! :smile:

Totally — that’s definitely been an ask! Depending on the use case, you might be able to create a form that you link to your workflow as a trigger, but we’ve discussed productizing the real use case in the past.

Do you have any recommendation for form UIs? Something like Google Forms I guess?

We use Tally for some forms internally, they have the sleakest form builder I’ve seen

And we have a trigger for new responses :+1::skin-tone-2:

Here is an example: New Pipedream Integration Request

Btw @U05LWJMUX0A would love to know more about your specific use case for this type of feature

For us it’s mostly to run pipelines. Typically, those pipelines run with default values (yesterday, or last hour, etc.).

But sometimes, for various reasons, we may need to run them with a value that’s different than the default (two days ago, or last week, or even all historical)

So we just need a simple way to manually specify those values when we need to.

Gotcha

If we could define a manual trigger with props (the same way we can for actions), it would be amazing. :ok_hand:

And those props would become the values of the manual trigger event.

Basically it could be just like a node.js code step, but used as a trigger. :smile:

For me the use case is that I can’t deploy this yet because the full workflow can’t be automated yet. So I need a way to put those field manually. IF I have a table where I can put key/values, that makes it easier than inserting these values in an XML every time.

Posted thread to Discourse: How to Add Values in a Flow and Use Them Dynamically Later in Pipedream?