When to use it
Use it for the small transformations no other gambit does. Reformat a date, derive a total, normalize a phone number, pick a field out of an earlier API response. For fetching data, use API Call. For anything reusable across agents, write it as a CodeKit action instead.The gambit and its editor
Every page in this section shows the same demo flow: Start, a Welcome message, the gambit this page covers, then End. The gambit sits third, selected, with its editor open on the right. The rest of the screen is dimmed. The editor holds Configuration and the Conditions switch. It has no Messages section.Configuration
What the code can reach
The editor seeds a new gambit with a comment naming what is in scope:variablesis a read-only snapshot of the conversation, grouped into namespaces:response,api,post,flow,agent,system,utm,url,enduser, andtrigger. An input gambit’s capture lives atvariables.response.<name>, keyed by the name in its VARIABLE field.setVariable(name, value)writes into the flow namespace. Read it back asvariables.flow[name]in code, or as{{flow.name}}in messages and conditions.- The returned value is stored in this gambit’s own variable. Return
nullwhen the code only writes throughsetVariable.
