<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Code in Ticket-Based Workflow Not Receiving Inputs or Writing Outputs” in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150804#M82059</link>
    <description>&lt;P class=""&gt;Thanks for this — that clears things up.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;We were previously using &lt;SPAN class=""&gt;input.get('subject')&lt;/SPAN&gt; and returning data directly in the root return object instead of using &lt;SPAN class=""&gt;outputFields&lt;/SPAN&gt;. Your Python example using:&lt;/P&gt;&lt;P class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-10 at 8.04.36 am.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145607i9831D35A0D5D569B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-05-10 at 8.04.36 am.png" alt="Screenshot 2025-05-10 at 8.04.36 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class=""&gt;and wrapping the return inside &lt;SPAN class=""&gt;outputFields&lt;/SPAN&gt; aligns with the working pattern we needed. We’ll update the script and test again.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Appreciate the help — this was the missing piece.&lt;/P&gt;</description>
    <pubDate>Fri, 09 May 2025 22:06:47 GMT</pubDate>
    <dc:creator>AMGorilla</dc:creator>
    <dc:date>2025-05-09T22:06:47Z</dc:date>
    <item>
      <title>Custom Code in Ticket-Based Workflow Not Receiving Inputs or Writing Outputs”</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1146478#M82039</link>
      <description>&lt;P class=""&gt;Hi all,&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;We’re running into what looks like either a limitation or a silent failure inside HubSpot’s internal Custom Code actions within ticket-based workflows, and I’d like to know if anyone else has encountered this.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Setup:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Workflow Type: Ticket-based&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Using a Custom Code action to extract an order number from the ticket name (subject) and write it to a custom property (debug_log)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Inputs specified in the code step:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;subject — Ticket&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;hs_object_id — Ticket&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;debug_log ← Action outputs → Custom Code → debug_log&lt;/P&gt;&lt;P class=""&gt;Output is mapped via a “Set property value” action:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;Observed Behavior:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Workflow runs and shows as completed successfully&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Ticket does not update&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;debug_log remains blank&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Even static values (like “RUN TEST 001”) don’t write&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Confirmed subject is never passed into the custom code (comes through as empty)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;What’s Already Verified:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Workflow is running in Sandbox (and mirrored in Prod)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;User is Super Admin&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;debug_log is a custom property on Tickets, type: single-line text&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;All field mappings are correct&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Rebuilt the workflow multiple times from scratch&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Input and output property names are all correct&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Confirmed no permission issues, no read-only fields, no conditional branches blocking execution&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;Ask:&lt;/P&gt;&lt;P class=""&gt;Has anyone successfully used Custom Code actions in ticket-based workflows where:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P class=""&gt;Properties like subject are passed in and accessible?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Outputs can be written to ticket properties?&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P class=""&gt;I’ve already escalated this to HubSpot Support, but posting here in case it’s a broader issue others have encountered or if someone from the product/dev team is monitoring.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Thanks in advance. Happy to share screenshots or configuration details if helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 12:38:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1146478#M82039</guid>
      <dc:creator>AMGorilla</dc:creator>
      <dc:date>2025-05-09T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code in Ticket-Based Workflow Not Receiving Inputs or Writing Outputs”</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1146511#M82042</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Confirmed subject is never passed into the custom code (comes through as empty)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;How are you accessing the data? Via the property includes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelMa_3-1746798081067.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145560iD99C29E5DB3616F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichaelMa_3-1746798081067.png" alt="MichaelMa_3-1746798081067.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you accessing the variable correctly in your Custom Code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg, here is some simple code to grab the subject from the input fields and output it in the console and passes the variables out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Properties to include are accessed via the object event.inputFields (case sensitive).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;exports.main = async (event, callback) =&amp;gt; {
  var debug_log = event.inputFields['subject']; //Grabbing ticket name from the passed in vars
  console.log("Original Ticket Name:", debug_log)
  
  debug_log = debug_log.replace(/\D/g,'') //Removing Alpha leaving only Numbers
  console.log("Process Order ID:", debug_log)
  
  /*****
    Use the callback function to output data that can be used in later actions in your workflow.
  *****/
  callback({
    outputFields: {
      debug_log: debug_log
    }
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelMa_4-1746798312033.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145561i618A819DD0EE9EF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichaelMa_4-1746798312033.png" alt="MichaelMa_4-1746798312033.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you confirmed that the output is fine, it's mostly selecting the correct items:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelMa_6-1746798497577.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145563i45428220F0B174E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichaelMa_6-1746798497577.png" alt="MichaelMa_6-1746798497577.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 13:48:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1146511#M82042</guid>
      <dc:creator>MichaelMa</dc:creator>
      <dc:date>2025-05-09T13:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code in Ticket-Based Workflow Not Receiving Inputs or Writing Outputs”</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150783#M82051</link>
      <description>&lt;P class=""&gt;Thanks for the response — I appreciate you jumping in.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Just to clarify: this workflow is using HubSpot’s &lt;SPAN class=""&gt;&lt;STRONG&gt;internal Custom Code Action&lt;/STRONG&gt;&lt;/SPAN&gt; (built directly in the workflow editor), &lt;SPAN class=""&gt;&lt;STRONG&gt;not a private app or external function&lt;/STRONG&gt;&lt;/SPAN&gt;. That means it’s Python-based, and the standard format is:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-10 at 6.56.20 am.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145604i6748B50F19FBFF3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-05-10 at 6.56.20 am.png" alt="Screenshot 2025-05-10 at 6.56.20 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class=""&gt;We’ve explicitly included &lt;SPAN class=""&gt;subject — Ticket&lt;/SPAN&gt; as a property to include. Despite that, the value doesn’t come through — even when hardcoding the return value in the code step, the ticket property (&lt;SPAN class=""&gt;debug_log&lt;/SPAN&gt;) doesn’t update.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;So far we’ve:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;Verified property names and types&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Confirmed correct input/output mapping&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Manually enrolled test tickets&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Used Super Admin permissions&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Rebuilt the workflow from scratch&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Still getting no values on output, and no &lt;SPAN class=""&gt;subject&lt;/SPAN&gt; being passed into &lt;SPAN class=""&gt;input&lt;/SPAN&gt;.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Do you know of &lt;SPAN class=""&gt;&lt;STRONG&gt;any current limitations or known bugs&lt;/STRONG&gt;&lt;/SPAN&gt; with internal Custom Code Actions inside ticket-based workflows not binding inputs properly?&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 20:59:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150783#M82051</guid>
      <dc:creator>AMGorilla</dc:creator>
      <dc:date>2025-05-09T20:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code in Ticket-Based Workflow Not Receiving Inputs or Writing Outputs”</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150791#M82056</link>
      <description>&lt;P&gt;My response is still the same except change my NodeJS code to Python.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to use Output fields if you want to pass the data to other nodes. If you create a new Custom Coded action node, the default code presented (in Python) has a lot of the default functionality that you would need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;event is the primary variable that the nodes uses to access the data. event['inputFields'] are where it stores the properties you added in the Custom Coded Action.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OutputFields is how it passes data out from the node and able to access it to other nodes so you have to use that so it's accessible by other nodes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So presuming the same as before but using Python:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def main(event):
  debug_log = event["inputFields"]["subject"]
  print (debug_log)
  # Return the output data that can be used in later actions in your workflow.
  return {
    "outputFields": {
      "debug_log": debug_log
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if you test the Custom Coded Action node, you can see the output data and logs.&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 21:43:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150791#M82056</guid>
      <dc:creator>MichaelMa</dc:creator>
      <dc:date>2025-05-09T21:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code in Ticket-Based Workflow Not Receiving Inputs or Writing Outputs”</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150804#M82059</link>
      <description>&lt;P class=""&gt;Thanks for this — that clears things up.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;We were previously using &lt;SPAN class=""&gt;input.get('subject')&lt;/SPAN&gt; and returning data directly in the root return object instead of using &lt;SPAN class=""&gt;outputFields&lt;/SPAN&gt;. Your Python example using:&lt;/P&gt;&lt;P class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-10 at 8.04.36 am.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145607i9831D35A0D5D569B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-05-10 at 8.04.36 am.png" alt="Screenshot 2025-05-10 at 8.04.36 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class=""&gt;and wrapping the return inside &lt;SPAN class=""&gt;outputFields&lt;/SPAN&gt; aligns with the working pattern we needed. We’ll update the script and test again.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Appreciate the help — this was the missing piece.&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 22:06:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Code-in-Ticket-Based-Workflow-Not-Receiving-Inputs-or/m-p/1150804#M82059</guid>
      <dc:creator>AMGorilla</dc:creator>
      <dc:date>2025-05-09T22:06:47Z</dc:date>
    </item>
  </channel>
</rss>

