Block reference / Online services
Grok
Ask an xAI Grok model a question built from the run's data and keep the answer in a variable.
In both apps
WarpX Browser
WarpX Phone
Grok does the same job as ChatGPT with xAI's models: write, summarise, extract or classify from what the run collected, and keep the answer for later blocks. Its key comes from the xAI console. The answer is text, or an object with Answer in JSON, saved as an object.
Settings
- API key
Your key, from
console.x.ai. Keep it in Databases → Credentials and write{{secrets.grokKey}}here, as the hint under the field suggests: the workflow file then holds the name, not the key, and the run's log shows••••••wherever the key would appear.Example{{secrets.grokKey}}- Model
The model to ask. Empty means
grok-4. The field suggestsgrok-4,grok-3,grok-3-mini, but it is free text: any model name the provider offers can be typed in.Examplegrok-3-mini- Instructions (optional)
The system prompt: how the model should behave on every run, separate from the question. Good for the format of the answer, the language, the length. Leave it empty to send the prompt alone.
ExampleReply like a friendly person, in one or two sentences, in the language of the post. Never mention being an AI.- Prompt
The question. References such as
{{variables.pageText}}or{{loopData.row.name}}are filled in before it is sent, so one block asks something different for each profile or row. The block fails withThe prompt is emptyif nothing is left after they are filled in.ExampleWrite a reply to this post: {{variables.postText}}- Temperature
How varied the answer is, usually from
0(the same answer every time) to1or more (more creative). Empty, shown as Model default, sends nothing and lets the model use its own. Some reasoning models accept only their default.Example0.8- Max tokens (0 for no limit)
The longest answer the model may write, in tokens (roughly three quarters of a word each).
0sends no limit. An answer cut short ends withcut off at the token limitin the log line.Example120- Answer in JSON, saved as an object
Asks the model for JSON and parses the answer, so later blocks read its parts, such as
{{variables.summary.price}}. Say in the prompt which keys you want. If the answer still is not valid JSON, the text is kept as it came.ExampleUnchecked- Assign to variable
Keeps the answer in a variable. On for a new block.
ExampleChecked- Variable namewhen Assign to variable is ticked
The variable that receives the answer.
aiResponseon a new block.Examplereply- Insert to table
Also writes the answer into a column of the workflow's table. Offered only when the workflow has table columns. A JSON answer is written as the object.
ExampleUnchecked- Select columnwhen Insert to table is ticked
The column that receives the answer.
Examplesummary
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
The answer goes to the variable you named, here {{variables.reply}}, to the table column if you chose one, and on to the next block as {{prevBlockData}}. With Answer in JSON, saved as an object it is an object; otherwise it is text. The log line reads like Grok <model> · 412 tokens, and opening it shows the prompt, the instructions and the answer the run actually used. The block leaves by its single output. When the provider refuses, the block fails with the provider's own reason, such as Grok answered 401: Incorrect API key provided.
Example: Write a reply that fits the post
- Start
- Open URL
- Get text
- Grok
- Click element
- Type text
- Click element
- Create a key in
console.x.aiunder API Keys and save it in Databases → Credentials asgrokKey. - Add Open URL with the post's address, then Get text on the post body with Assign to variable
postText. - Add Grok with API key
{{secrets.grokKey}}and Modelgrok-3-mini, which is quick and cheap for short text. - Put the tone and length in Instructions (optional) and
Write a reply to this post:followed by{{variables.postText}}in Prompt. - Set Temperature to
0.8, Max tokens (0 for no limit) to120, and name the variablereply. - Add Click element on the reply box, Type text with Text to type
{{variables.reply}}, and Click element on Reply. - Run it. The log line reads like
Grok grok-3-mini · 154 tokens.
Good to know
- The request goes from this computer straight to xAI, not through the profile's browser or its proxy. The provider sees your own connection, and it bills your key for every run.
- The prompt, the instructions and the answer are kept in the run's log. Values that came from Credentials are shown there as
••••••, but anything else you put in the prompt — scraped text, an email address — is written down as it was sent. - A key typed straight into API key is saved in the workflow and travels with every exported copy of it.
{{secrets.name}}avoids that. - The block waits up to two minutes for an answer. A slow model with a long answer can hit that; ask for less, or set Max tokens (0 for no limit).
- Each run of the block is one new conversation: the model does not remember earlier runs or earlier blocks. Put everything it needs into the prompt.
- Leave Model empty and the block uses
grok-4, xAI's largest model, which costs more and answers more slowly. For short text, name a smaller model.
See also
- ChatGPT — Ask an OpenAI model a question built from the run's data and keep the answer in a variable.
- Gemini — Ask a Google Gemini model a question built from the run's data and keep the answer in a variable.
- DeepSeek — Ask a DeepSeek model a question built from the run's data and keep the answer in a variable.
- Type text — Put text into an input, textarea or editable element.