How to properly map Data Pills and Action Inputs using the sn_text2flow API?

divyashah
Tera Guru

Hi everyone,

I am working on a use case involving autonomous flow generation and could use some advice on how to properly populate data pills programmatically.

I am currently using the Now Assist API sn_text2flow.TextToFlowUtil() via a backend script to generate a Flow based on dynamic inputs.

 

The Success: I am able to successfully generate the Flow skeleton using buildFlowWithAI(prompt, "", flowProps, true, []). It creates the trigger and places the correct actions (e.g., Wait for Condition, Send Email, Update Record) in the right order.

 

The Problem: The generated Flow is just a skeleton. None of the action inputs or data pills are populated.

I have attempted to use the sn_text2flow.TextToFlowDataPillUtil().populateInputsWithAI() method by passing in the prompt, strict context, and the flowSkeleton components, but the flow still generates with empty action parameters. It seems like the inputs might be modifying in memory but failing to commit to the sys_variable_value table, or the prompt/JSON payload is not structured exactly as the API expects.

 

My Questions:

  1. Initial Prompting: Is it possible to map data pills natively during the initial buildFlowWithAI call by using specific syntax in the prompt (e.g., passing explicit Flow Designer notation like {{trigger.current}})?

  2. DataPillUtil Formatting: If populateInputsWithAI is the required path, what is the exact JSON structure it expects for the flowSkeleton and components arrays?

  3. Committing Changes: Is there a secondary "save" or "commit" method required after running the Data Pill utility to actually write those values to the database before calling prepareFlow()?

Any insights, documentation links, or working examples of formatting the payload to successfully bind data pills would be highly appreciated.

Thank you!

0 REPLIES 0