Workflow output not present with Go To Workflow call

I need to know the current date time in my current custom workflow. HubSpot does not offer any step for this, so I decided to create a custom code workflow whose sole purpose is to supply an ISO8601 current date time.

I’ve setup a custom workflow with some code that does this:

exports.main = async (event, callback) => {
 callback({
 outputFields: {
 currentDateTime: new Date().toISOString()
 }
 });
}

I’ve defined the output in the re-usable workflow, and this all works and returns a datetime (a String containing the ISO8601 formatted datetime).


Output set


Workflow working, output working

Now, when I want to use this from my main workflow, I can call it, but the “currentDateTime” output is not shown! Only the success state?

How do I get my output to show up? I’ve looked through all the settings, but can’t find anything else.

Hi @scspijker,

As far as I know, you can’t reference the output of an action from another workflow - even if you sent a record there from your current workflow.

In other words, if you send a record from workflow1 to workflow2 and workflow2 is the one with the custom code action, you can’t access the output of the action in workflow2 within workflow1.

You would have to include the custom code action in workflow1 so that you can reference it’s output. (Unless you’re planning on regularly changing the code - which doesn’t seem to be the case - I don’t think there’s any issue with that.)

Best regards