Custom scripting
Introduction
'Out of the box', Patchworks pulls data from a source system and pushes it into a destination system, using field mappings to decide where each item of source data should be placed in the destination system.
Patchworks provides default mappings which can be adjusted if needed, and a comprehensive set of transform functions that can be used if your source data doesn't quite slot neatly into the destination.
However, requirements for manipulating source data can be more complex than any standard set of transform functions can handle. If this is your position and you have developer experience in-house, custom scripting can be used to write and maintain your own scripts.
Using our integrated editor with IntelliSense, you can get as complex as you need with a choice of coding languages.
How are custom scripts used?
Once a script is deployed, it can be selected for use in process flows via:
Script shapes (run a script at any point in a process flow)
Map shapes (add a script transform function to run a script to transform source fields before they are pushed to destination fields)
'Cold storage'
If a custom script has not been used for 4 days and is NOT associated with an
enabled
process flow, it is un-deployed and placed in 'cold storage'. If you add an un-deployed script to a process flow (via the script shape or a script transform) it will be re-deployed automatically when called.If a custom script is associated with an
enabled
process flow, it will never be un-deployed and put into 'cold storage'.
Supported languages
The following coding languages are currently supported for custom scripting:
Language | Version(s) |
---|---|
C# | 8.0 |
Javascript | Node 18 |
PHP | 8.1 & 8.2 |
Python | 3 |
Ruby | 3 |
Supported libraries & packages
Default packages are available for supported coding languages. Additionally:
Language | Package/library | Version | Summary |
---|---|---|---|
Javascript (JS Node) | ^10.8.6 | For encryption and JWT support. | |
^1.6.11 | For XML support in javascript functions. | ||
Python | 2.32.3 | Allows you to send HTTP/1.1 requests very easily. | |
PHP | ~3.0 | For connecting to SFTP/SSH and various other secure connection types. | |
- | Provides arbitrary precision arithmetic operations. | ||
1.11.0 | Provides functions for accessing remote machines using the secure SSH and SFTP protocols. | ||
Latest | Provides access from PHP to MySQL databases. |
If you require additional libraries you can:
embed them in your script directly
submit a request to Patchworks support for a library to be included globally
Related pages
Last updated