This topic was automatically generated from Slack. You can find the original thread here.
Can I create a workflow, where I manually input a variable and press TEST WORKFLOW?
This topic was automatically generated from Slack. You can find the original thread here.
Can I create a workflow, where I manually input a variable and press TEST WORKFLOW?
Yes, you can create a workflow with a code step that accepts manual input using the props
feature in a Pipedream component. Here’s an example component that accepts a string input: ```
export default defineComponent({ props: { inputText: { type: “string”, label: “Input Text”, }, }, async run({ steps, $ }) { // Example code — returns the value of the input prop to the user return this.inputText; }, });
I do not see the PROPS feature.
I apologize for the confusion. The props
feature is used within Pipedream components in Node.js code steps. To use props
in a workflow, you’ll need to add a new Node.js code step and define the props
within the defineComponent
function. Here’s an example: ```
export default defineComponent({ props: { inputText: { type: “string”, label: “Input Text”, }, }, async run({ steps, $ }) { // Your code here, using this.inputText to access the input value }, });
How do I run NODE from the trigger?
To run Node.js code in a Pipedream workflow, you can use a code step. First, add a trigger to your workflow (e.g., HTTP, Scheduler, or an app-based trigger). Then, add a new Node.js code step after the trigger. Inside the run
method of the defineComponent
function, you can write your Node.js code. Here’s an example: export default defineComponent({ async run({ steps, $ }) { // Your Node.js code goes here }, });
Place your Node.js code inside the run
method, and it will execute when the workflow is triggered.
: We’ve previously discussed the idea of having a manual trigger in this thread.