1. Home
  2. Workflows
  3. How do I configure custom workflow scripts?

How do I configure custom workflow scripts?

What are custom workflow scripts?

Custom workflow scripts are scripts written in Python that allow you to implement various use cases in your workflows that are not supported by Headlight by default. For instance, you could use a custom script to interface with your in-house platform to update user information. Alternatively, you could use a custom script to implement complex calculations, or map input to output in a non-obvious way.

How do custom workflow scripts work?

When custom scripts are executed, the handler function receives an event that contains a payload with all of the parameters of the workflow. You can return key-value pairs which are then made available in the parameters of downstream components. When configuring the script, you must identify the parameter references you will use.

A custom script must always contain a handler function called handler. The handler takes one argument, which is the payload of parameters of the workflow execution.

Custom python script example

What am I allowed to do in a custom workflow script?

Custom scripts are executed in a Sandbox. This means that you cannot access all of the packages, modules, and functions that you might be able to access in your own environment. Nonetheless, most of the important built-in functions are available. By default, we also make the requests package available, so that you can access the public internet with convenience.

If you need access to third-party packages, contact support to review whether they can be made available to you.

Was this article helpful?

Related Articles

Leave a Comment