Performs flexible AI-powered data processing using custom prompts for content generation, analysis, summarization, and classification.
The aiProcessing function performs flexible AI-powered data processing using custom prompts. This function gives you complete control over how AI analyzes, transforms, or generates content based on your specific requirements.
Executes custom AI processing tasks using natural language prompts. Unlike the structured extraction of aiExtractVariables, this function is designed for open-ended AI tasks like content generation, analysis, summarization, classification, or any custom processing logic you can describe in a prompt.
Key Differentiator: Unlike aiExtractVariables which extracts specific structured data, aiProcessing allows open-ended AI tasks that you can describe in natural language prompts.
Execute any AI task you can describe in natural language
Return results as plain text or structured JSON
Can extract information from images when provided with image buffers
Create new content based on input data and instructions
Convert data between formats or apply complex business logic
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Natural language instructions for the AI to follow | |
| output_type | string | Optional | Format of response: "text" (default) or "json" |
| image_buffer | buffer | Optional | Image data to analyze alongside text |
| image_mimetype | string | Optional | MIME type of the image (e.g., "image/png") |
Returns the AI's response as a string:
Returns parsed JSON object when output_type: "json":
When processing fails:
Basic conversation summarization using aiProcessing:
Analyzing customer sentiment and returning structured data:
Analyzing document images alongside text prompts:
Converting data formats for API integration:
Generating professional email responses with specific requirements:
Creating comprehensive reports by combining data from multiple workflow steps:
JSON Output Note: When using output_type: "json", you must include a request in the prompt to respond as a JSON Object (e.g. "Provide your response as a JSON Object").
Clear, detailed instructions produce better results. Specify exactly what you want the AI to do and what format you expect.
Choose "json" when you need structured data that other steps can easily reference, and "text" for human-readable content.
Reference previous step outputs and relevant variables to give the AI complete context for processing.
When working with data from previous steps, ensure your prompts can handle variations in data structure and content.
These functions complement aiProcessing for building comprehensive AI-powered workflows: