Tailflow
Skip to article
Browse documentation

OpenAI · Action

Extract structured data

Asks an OpenAI model to fill in the fields you name from the event, and hands them on as data, one value per field.

When to use it

Turning a messy event into the columns a table needs: the project a token belongs to, whether a transfer looks like a payment, a one word category.

At a glance

IntegrationOpenAI
Credits2
ConnectionOpenAI, by pasting a key

Settings

fieldsRequiredAccepts event fields
Fields. One row per value you want. The name is what later steps read, such as data.project. The value says what it should hold, in plain words. One row per name and value.
promptOptionalAccepts event fields
Instructions. Optional. The event is given to the model alongside this, as data.
model
Model. Leave it on the default, or choose a model your OpenAI account can use. Picked from your account's own list, or typed.
max_output_tokens
Answer length limit. The most the model may write, counted the way OpenAI bills it. About 750 words per 1,000, and the model's own thinking counts too. At most 32,000. A whole number. Under More options.

What it hands on

Actions run in order, and each one can read what the actions above it produced. This one writes the fields below; a later action reaches them as {{ actions.openai_extract_1.data }} — the action’s key, then which one it is if you use more than one of the same kind.

data
The values by field name, for example data.project. A field the event does not answer is empty.
model
The model that answered, as OpenAI names it.

Good to know

  • Runs on your own OpenAI key. OpenAI bills your account for what the model reads and writes.
  • A key whose account has run out of credit fails the step with that reason. The flow keeps trying on later events, so it carries on once credit is added, and stops after several failures in a row.
  • Token names, symbols and other values in an event can be written by anyone. The model is told to treat the event as data and never to follow instructions inside it.
  • The model is held to exactly the fields you name. Every value is text, or empty when the event does not say.
  • Descriptions are taken as written. A value from the event cannot go in one.