Custom Code - output not being recorded

I have a really annoyng issue that im sure I’m just missing something simple. I have a workflow with some custom code, I’m trying to retrun a value into an output field but uts just not showig but it successsfully shows in the logs.

Here is an an example:

exports.main = async (event) => {
const testValue = “Static Test Value”;

const output = {
outputFields: {
iname: testValue
}
};

console.log(“Returning Output:”, JSON.stringify(output));

return output;
};

Hi @ABatchelor8,

If you are using Node.js in the custom coded workflow action, you should use the callback parameter instead of the return statement.

Your code would look something like this:

exports.main = async (event, callback) => {
const testValue = "Static Test Value";

// checking output value in console
console.log("Returning Output:", testValue);

 callback({
 outputFields: {
 iname: testValue
 }
 });

};

Legend +