What is the fastest method for converting double to int in a workflow with slack interaction event?

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

  1. Trigger: Triggered by slack interaction event.
  2. Step1 - Execute node code to convert action_ts data to int type. (From double timestamp to int timestamp)
  3. 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??

Hi , may I ask did you deployed your workflow, or are you still testing it in Builder UI? I’m asking this because the deployed workflow might behave differently (.i.e faster) than when you’re testing

Hi Already deployed and using it for logging start working time.

Thanks could you share the screenshot where you see the node.js code step takes 10 seconds?

Oh, node code is not takes 10 seconds. From the click the slack interaction button to receive slack message takes 10 seconds. Trigger to step 2 (Entire workflow)

It is fine now but I just looking for the fastest way.

Hi , I think you’re observing the cold start behavior. Could you read through the document below to understand it and ways to improve it?

And I already attached the node code above.

Not yet, I’ll read. Thanks

I got inspiration from this document. Thanks a lot!