This topic was automatically generated from Slack. You can find the original thread here.
Hello. Can I have a question about step in workflow?
My simple workflow do
- Trigger: Triggered by slack interaction event.
- Step1 - Execute node code to convert
action_ts
data to int type. (From double timestamp to int timestamp) - Step2 - Send slack message to a public channel
// Step1 Code
// To use previous step data, pass the `steps` object to the run() function
export default defineComponent({
async run({ steps, $ }) {
// Reference previous step data using the steps object and return data to use it in future steps
const timestamp = parseInt(steps.trigger.event.event.actions[0].action_ts);
const userId = steps.trigger.event.event.user.id;
var result = {};
result.timestamp = timestamp;
result.userId = userId;
return result;
},
})
At the first without the step 2, sending slack message was very fast. But after adding step1, it take about 10 seconds when the node code not cached.
What is the fastest way to change double value to int and pass to next step.
I tested 3 ways. 1. Node code with Run Node Code
type. 2. Node code with Pass data between steps
3. Python with Pass data between steps
and feel 2 is the fastest way among the these methods.
Is there better way to short time of convert type??