viaSocket Help

AI Field

An AI Field allows users to automatically generate API-ready data by providing natural language instructions during the workflow setup.


#

Common Use Cases

Use the AI Field when the workflow requires complex data that is difficult to construct manually:

  • Filter Generators: Creating complex JSON filter objects (e.g., for Notion or Pipedrive).

  • Query Builders: Generating dynamic search conditions or database queries.

  • Payload Construction: Converting simple user prompts into formatted API JSON payloads.

  • Metadata/Content: Creating structured content blocks or dynamic metadata.

#

How an AI Field works?

Step

What Happens

1

User enters instructions

2

Optional schema/data is sent using suggestionGenerator

3

AI reads the prompt and available context

4

AI generates API-ready output

5

The generated output is stored and later used in the workflow

#

Configuration

Add Field → Select AI Field

Use the following JSON structure to define an AI field in your action or trigger:

Property

Value

Example

Prompt

Instructions that tell the AI what kind of output to generate and in what format

Generate valid Notion filter JSON using the provided database schema

suggestionGenerator

Provides additional field information or sample data to help the AI generate more accurate output

Return database column names and field types

[
  {
    "key": "filter_conditions",
    "type": "aifield",
    "label": "Filter Conditions",
    "help": "Generate valid Notion filter JSON using the provided database schema",
    "required": true,
    "prompt": "Write a prompt to guide the AI.",
    "suggestionGenerator": " // Enter JS code response of which will be sent to AI later used by ai to generate results"
  }
]

Additionally, attributes like visibilityCondition can be used as per need and requirement.