Deluge function failing field update using Deal ID

Deluge function failing field update using Deal ID

I'm receiving this error with my function and cannot understand why.

Value given for the variable 'id' does not match its type at Line Number: 1


This is my function. Essentially I want to get 2 date fields from a Deal record and populate a third field with the datesBetween value.

enqcall = zoho.crm.getRecordById("Deals",id.toString());
tourStartDate = enqcall.get("Start_Date");
info tourStartDate;
tourEndDate = enqcall.get("Tour_End_Date");
info tourEndDate;

if(tourStartDate && tourEndDate is not null)
{
      startDate_date = tourStartDate.toDate();
      endDate_date = tourEndDate.toDate();
      tripLength = daysBetween(tourStartDate,tourEndDate) + 1;
      info "tripLength: " + tripLength;
      query_Map = Map();
      query_Map.put("Trip_Length",tripLength);
      updateenq = zoho.crm.updateRecord("Deals",id.toString(),query_Map);
      info "update: " + updateenq;
}
Here's my argument. "Enquiries" is just our custom rename for the "Deals" module.




This function works fine when executed in Deluge, calculating the days between and updating the record, however it has this error when trying to trigger in the workflow. I have a near identical function used to calculate something else that works in a different workflow so I don't know what could be the issue.

Thanks,
Jack