Automatic mode

Transform data based on guidance written in plain English.

Under the hood, this feature uses build-time AI to compose Python code based on the guidance and the input you provide. Once you save your changes, the code is locked in place. This means that when the action runs, only the code executes, and no AI is involved.

Features 

  • Powerful transformations: author data transformations, with all the power of code, without needing to know how to write code

  • Self documenting: read plain English descriptions to understand the transformation, without needing to know how to read code

Configuration Options 

  • mode: 'automatic'

  • input: the data the action will operate on

  • guidance: a plain English description of how input should be transformed to output

Example Configuration Options 

Given the incoming event below, generate a message for each element in the object.

{
  "teams": { "team_1": { count: 5 }, "team_2": { count: 7 } }
}
{
  "mode": "automatic",
  "input": "<<teams>>",
  "guidance": "Name of the team with the highest count"
}
{
  "output": "team_2"
}

Practical example 

Let's say you had a webhook action that was set up to listen for any github events from your organisation's repo, and you wanted to use an automatic Event Transform Action to extract the relevant info.

The Github event data is fairly large, with a lot of info we don't care about (truncated sample):

{
  "github": {
    "body": {
      "action": "created",
      "issue": {
        "url": "https://api.github.com/repos/tines/tines/issues/XXXX",
        ...
        "title": "Turn on token bucket for sprinklr",
        "user": {
          "login": "tinesengineer",
          ...
        },
        "state": "closed",
        "body": "let's get more data",
        ...
      }
    }
  }
}

When you open the automatic Event Transform Action editor, it will assume that last-received event is the sample input you're using to generate the python script. After you type your prompt and hit Generate, the automatic Event Transform Action will use the input data and the prompt to generate a python script.

It will also immediately run the generated script with the sample input data and show the output:

You can modify the prompt or the input and regenerate the script as many times as you want. When you're certain that the script will handle all of your use cases, you can click Save to lock the generated script in place. Any subsequent events that are passed into the automatic Event Transform Action will be transformed by this script.

At any time you can reopen the automatic Event Transform Action to modify the prompt and/or use new data to regenerate the script. You can also click Copy as Run Script in the bottom right to extract the script as a standalone Run Script Action if you want to modify the script yourself.

Was this helpful?