Skip to main content

Automation Center - Custom Scripts

Test and deploy custom logic or integrations quickly with the Automation Center's custom script action

With the Automation Center's Custom Script action option, you can write Node.js code when creating automations in the Automation Center. This provides more flexibility and autonomy, and enables you to test and deploy custom logic or integrations quickly and safely, without needing a third-party integration tool like Workato.

Custom Scripts Run Code Against Your Account

Custom scripts execute code that can read and change account data, so build and review them with a technical owner or administrator. Store secrets such as API keys as environment variables rather than in the script body, and confirm a script behaves as expected on a limited opening before relying on it broadly.


Create a Custom Script Automation

To create a custom script automation rule, follow the steps below:

  1. Click your company logo in the bottom left corner. Then click Settings.

  2. Click the Automations settings link. If you do not see this option, reach out to your Fountain Customer Success contact or [email protected] to enable the Automation Center in your account.

  3. Click +Add Automation in the top right corner.

  4. Follow the steps outlined in this article when selecting the source, trigger(s), and optional filter(s).

  5. In the Action section, select the Run a custom script action type.

  6. Select Code to type in the code directly. Select Package to import files.

    1. +Add an environment variable is used for data that shouldn't be hardcoded. Often in a custom script, you may use things like an API key or a user name and password. Instead of hardcoding those in the body of the script, you can use this section for that data.
      ​

  7. Click Apply

  8. Click Next in the top right.

  9. Type a name for the automation and an optional description.

  10. Click Activate.

Use the Read Documentation link for examples
For example scripts and starting-point templates, click Read documentation. The documentation includes ready-to-use scripts for common use cases such as HRIS API calls, Slack notifications, and attribute updates — a useful reference when building your first custom script.


Plan for the 5-Second Run Limit

Each run of a custom script has 5 seconds and 1,024 MB of memory. If the script is still running after 5 seconds, it is stopped and the run fails.

A script cannot wait and try again later in the same run, for example to retry a call after one minute. To retry after a delay, have the script send the work to your own endpoint or integration middleware, which waits and retries on its side. Write the script so that running it twice does no harm, since a failed run can be run again.

To stay within the limit, give each outside call its own timeout of about 3 seconds, and plan for about three calls per run, counting the call that gets an access token. Click Read documentation in the script editor for a timeout helper you can copy.

Customer Examples:

  • Used to replace special characters in a worker's name to avoid HRIS errors when the worker's information is sent to the HRIS system.

  • Used to update applicant attributes when a document provided as part of a Compliance Requirement's status changes.

  • Used to add additional information into a Worker's Profile from another source, like an HRIS or an older profile in Fountain that belongs to the same person.

  • Used with the "When an applicant sends a message" trigger to route inbound applicant SMS or email messages to a webhook endpoint, enabling automated replies or real-time escalation to a human recruiter.

Did this answer your question?