Note: This article is on the new Sandbox which is now enabled for Enterprise plan customers. For Freshservice's current Sandbox version click here. Click here to learn more about its phase-out plan.

We have identified that some of our customer's workflow automators use hardcoded IDs in their web request nodes or Webhook action nodes. This article contains information on how to replace hardcoded IDs with placeholders in Workflow Automators.
To avoid workflow execution failures in the Sandbox, replace hardcoded IDs with placeholders. This change is necessary because entity IDs (e.g., ticket IDs, agent IDs, asset IDs) will differ between Sandbox and Production environments.

Below are scenarios in which hardcoded IDs might be present in your workflows. Identify and fix similar issues in your account for a seamless Sandbox experience.

Scenario 1: Hardcoded IDs in Web Request Endpoints

Example: A workflow that adds an agent to a group might use an agent ID in the API endpoint, such as:

http://accountname.freshservice.com/api/v2/agents/233234

In the Sandbox, the agent ID will change (e.g., from 233234 to 456422), causing workflow execution to fail.

Expected Action: Use a placeholder in the endpoint URL:


http://accountname.freshservice.com/api/v2/agents/{{ticket.agent.id}}


If the agent whose profile needs to be updated is not the agent in the ticket, or if the agent’s ID is unavailable, derive the agent’s ID using another web request node and then use a reader placeholder.

Scenario 2: Hardcoded IDs in JSON Payload

Example: A workflow that updates the reporting manager of a user might use a hardcoded reporting manager ID in the JSON payload:

{

  "reporting_manager_id": 453

}

In the Sandbox, the reporting manager ID will change (e.g., from 453 to 678), causing workflow execution to fail.

Expected Action: Use a placeholder in the JSON payload:

{

  "reporting_manager_id": {{ticket.requester.reporting_manager.id}}

}

If the reporting manager whose ID is needed is not the requester’s reporting manager or if their ID is not available in the ticket, derive their ID by using another web request node and then use a reader placeholder.

Scenario 3: Hardcoded IDs in Field Names

Example: A workflow that updates an asset might use a hardcoded asset type ID in names of custom fields:

{

  "macosversion_54456": "Catalina"

}

In the Sandbox, the asset type ID will change (e.g., from 54456 to 86823), causing workflow execution to fail.

Expected Action: Use a placeholder in the field names in an API request payload:

{

  "type_fields": {

    "macosversion_{{ci_type_id}}": "Catalina"

  }

}

If the asset where the asset type ID needs to be updated is not present in the ticket or is unavailable, derive it using another web request node and then use a reader placeholder.

Pro Tip: You can also use this as an opportunity to try out the new sandbox. Switch over to the new sandbox if you haven’t already. Create a sandbox, perform these changes, and then sync the changes to your production account once the test results are satisfactory. 

If you have questions, reach out to us at support@freshservice.com.