LLM_COMPLETION
Call an LLM (OpenAI/Anthropic/Gemini) with a prompt; outputs its response.
What it does
Call an LLM (OpenAI/Anthropic/Gemini) with a prompt; outputs its response.
Inputs & outputs
| Input handle |
|---|
| userPrompt |
| Output handle |
|---|
| response |
Configuration
| Name | Type | Required |
|---|---|---|
| provider | 'openai' | 'anthropic' | 'gemini' | Yes |
| integrationId | string | Yes |
| model | string | Yes |
| systemPrompt | string | No |
| userPrompt | string | No |
| temperature | number | No |
| maxTokens | number | No |
| responseFormat | 'text' | 'json' | No |
Example
How it works
LLM_COMPLETION sends a prompt to an LLM provider using a bring-your-own key integration. Configure provider (openai, anthropic, or gemini), select the matching integration ID that holds the encrypted API key, and choose a model (e.g. gpt-4o, claude-3-5-sonnet-latest, or gemini-1.5-pro). The node accepts an optional systemPrompt for instructions and a userPrompt that can reference upstream values via backtick-wrapped variable references (e.g. {{text}}). Set responseFormat to json to receive a structured JSON string instead of plain text. The model's reply is available on the response output port.
Example
Scenario: A Slack bot Workflow receives an @-mention and replies with an AI-generated answer.
- A SLACK_TRIGGER fires when the bot is mentioned; its
textoutput carries the message. - Add an LLM_COMPLETION node. Set
providertoanthropic,modeltoclaude-3-5-sonnet-latest, and wiretextfrom the trigger into theuserPromptinput. Add asystemPromptsuch as"You are a helpful support assistant.". - Wire the
responseoutput to a SEND_SLACK node'smessageinput to post the reply in the same channel.
SLACK_TRIGGER ──(text)──► LLM_COMPLETION ──(response)──► SEND_SLACKTemperature and maxTokens are optional; leave them blank to use the provider's defaults.