Utilities
Utilities in ZBrain Flow are a set of tools and services that provide various essential functions for operating systems and applications. From tokenizing text and converting files to different formats to scraping web content and managing JSON data, Utilities helps streamline many common tasks and workflows within your automation.
How to Integrate Utilities with ZBrain Flow?
Click the “+” Button in the Flow Open your ZBrain Flow and select the plus sign (+) to add a new step.
Search for “Utilities” Type “Utilities” in the search bar to view the available tasks.
Choose the Desired Task Select the specific Utility you want to include in your Flow.
Tasks you can perform with Utilities
Tokenizer: Breaks down text into tokens and calculates the token count.
PDF to Text: Extracts text content from a PDF file.
File to Base64:Converts a file (e.g., PDF, image) into a Base64-encoded string.
PDF to Images: Splits a PDF document into individual image files (one image per page).
Web Scrapper: Extracts content from websites by scraping the specified URL.
App Output: Returns the flow’s output to the App chatbot.
Agent Output: Configures Agent Dashboard output.
JSON Processor: Stringifies or parses JSON based on the selected option.
Convert HTML to DOCX: Transforms HTML content into a DOCX file.
Convert HTML to PDF: Converts HTML content into a PDF file.
Tokenizer
Breaks down text into tokens and calculates the token count.
Useful for analyzing text length or preparing text for AI language model inputs.
How to Configure the “Tokenizer” Action in ZBrain Flow?
Step 1. Add the “Tokenizer” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select Tokenizer from the available actions.
Step 2. Configure the “Tokenizer” Action
Text
Provide the text you want to tokenize.
You can enter static text or map data from previous steps (e.g., user input, AI-generated content).
Encoder
Select the encoder to use for tokenization (e.g.,
cl100k_base
).This determines how the text is split into tokens and how many tokens are counted.
Step 3. Save and Test
Save Your Configuration
Once you’ve entered the text and chosen an encoder, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “Tokenizer” action processes the text as expected.
Check the Output
The output will typically include both the tokenized text (an array of tokens) and the total token count.
Use these tokens in subsequent steps if needed (e.g., limiting text length for an AI model).
PDF to Text
Extracts text content from a PDF file.
Ideal for quickly obtaining the text portion of PDFs for further processing or storage.
How to Configure the “PDF to Text” Action in ZBrain Flow?
Step 1. Add the “PDF to Text” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select PDF to Text from the available actions.
Step 2. Configure the “PDF to Text” Action
URL
Provide the URL of the PDF file you want to convert.
This can be a direct link to a file stored online, or you can map a variable containing the PDF’s URL from a previous step (e.g., after uploading the PDF somewhere).
Step 3. Save and Test
Save Your Configuration
Once you’ve provided the PDF URL, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “PDF to Text” action processes the file successfully.
Check the Output
The output typically includes the extracted text from the PDF. You can use this text in subsequent steps (e.g., analysis, storage, or search indexing).
File to Base64
Converts a file (e.g., PDF, image) into a Base64-encoded string.
Helpful for transmitting binary data in JSON or embedding images directly in HTML.
How to Configure the “File to Base64” Action in ZBrain Flow?
Step 1. Add the “File to Base64” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select File to Base64 from the available actions.
Step 2. Configure the “File to Base64” Action
URL
Provide the URL of the file you want to convert.
This can be a direct link to a file stored online, or you can map a variable containing the file’s URL from a previous step (e.g., after an upload).
Step 3. Save and Test
Save Your Configuration
Once you’ve provided the file URL, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “File to Base64” action processes the file successfully.
Check the Output
The output typically includes the Base64-encoded string of your file. You can use this string in subsequent steps (e.g., storing it in a database, sending via email, or embedding in JSON).
PDF to Images
Splits a PDF document into individual image files (one image per page).
Great for visually displaying PDF pages in web or mobile applications.
How to Configure the “PDF to Images” Action in ZBrain Flow?
Step 1. Add the “PDF to Images” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select PDF to Images from the available actions.
Step 2. Configure the “PDF to Images” Action
File
Provide the URL or path to the PDF file you want to convert.
You can map a variable containing the PDF’s URL from a previous step (e.g., an uploaded file).
Pages
Specify which pages of the PDF to convert.
Use “All” to convert the entire document.
Enter a range (e.g., 1-3) or comma-separated pages (e.g., 1,3,5) to convert only certain pages.
Images Resolution
Choose the DPI (dots per inch) for the output images.
High (300 DPI) is often used for print-quality images, while Standard (72 DPI) might be sufficient for on-screen viewing.
Step 3. Save and Test
Save Your Configuration
Once you’ve entered the PDF file location, pages (if desired), and resolution, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “PDF to Images” action processes the file correctly.
Check the Output
The output typically includes a list of generated image URLs—one for each converted page. You can use these images in subsequent steps (e.g., storing them, emailing them, or further processing).
Web Scrapper
Extracts content from websites by scraping the specified URL.
Perfect for gathering data or automating research from web pages.
How to Configure the “Web Scrapper” Action in ZBrain Flow?
Step 1. Add the “Web Scrapper” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select Web Scrapper from the available actions.
Step 2. Configure the “Web Scrapper” Action
URL
Provide the URL of the website you want to scrape.
Ensure the page is publicly accessible; login-protected or dynamically generated content may require additional steps or may not be fully supported.
Step 3. Save and Test
Save Your Configuration
Once you’ve entered the website URL, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “Web Scrapper” action successfully retrieves the site content.
Check the Output
The output typically includes the raw HTML or extracted text from the page. You can use this data in subsequent steps (e.g., parsing the HTML, searching for keywords, or storing it in a database).
App Output
Returns the flow’s output to the App chatbot.
Allows you to display or pass final results back to a user-facing interface.
How to Configure the “App Output” Action in ZBrain Flow?
Step 1. Add the “App Output” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select App Output from the available actions.
Step 2. Configure the “App Output” Action
Result
Provide the final output or message you want displayed to the user in the chatbot.
This can be plain text, or you can map data from previous steps (e.g., AI-generated content, database results).
Context (Optional)
Any contextual information that might appear in the query history logs.
This can help you or other team members understand how the response was generated.
Instructions (Optional)
Provide any instructions used in LLM (Large Language Model) interactions.
If you’re returning AI-generated content, you can note the prompt or instructions here for reference.
Model (Optional)
Specify the model used for generating the response (e.g., if you’re returning content generated by a particular AI model).
This is especially useful for logging or debugging multi-model workflows.
Temperature (Optional)
Controls the “creativity” of the AI’s response if you’re incorporating an AI generation step.
A lower value (e.g., 0.1) makes the output more focused and deterministic, while a higher value (e.g., 0.8) allows for more varied and creative responses.
Step 3. Save and Test
Save Your Configuration
Once you’ve entered the Result and any optional fields, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “App Output” action correctly returns a message to the chatbot interface.
Agent Output
Configures Agent Dashboard output.
Enables you to present data in a format suitable for agent interfaces or support dashboards.
How to Configure the “Agent Output” Action in ZBrain Flow?
Step 1. Add the “Agent Output” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select Agent Output from the available actions.
Step 2. Configure the “Agent Output” Action
Output
Provide the message or data you want to display on the Agent Dashboard.
You can enter static text or map data from previous steps (e.g., user inputs, API responses).
Tenant ID
Specify the tenant identifier for the Agent Dashboard environment where this output will appear.
Often, this is retrieved from a previous step or set as a static value if you know your tenant ID.
Worker ID
Enter the worker identifier corresponding to the agent or process you’re running.
This helps the Agent Dashboard know which worker instance the output is associated with.
Worker Record ID
Provide the record ID that ties the output to a specific job or workflow instance in the Agent Dashboard.
Useful for correlating multiple outputs to the same process.
API Key
Enter your API Key if required by your specific Agent Dashboard configuration.
This ensures secure authentication and proper routing of the output to the correct dashboard.
Step 3. Save and Test
Save Your Configuration
Once you’ve specified the Output and relevant IDs (Tenant, Worker, Worker Record) and provided any required API Key, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “Agent Output” action successfully sends data to the Agent Dashboard.
JSON Processor
Stringifies or parses JSON based on the selected option.
Handy for converting objects to JSON strings or interpreting JSON strings as structured data.
How to Configure the “JSON Processor” Action in ZBrain Flow?
Step 1. Add the “JSON Processor” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select JSON Processor from the available actions.
Step 2. Configure the “JSON Processor” Action
JSON Input
Provide the JSON object or string you want to process.
You can map data from previous steps (e.g., an API response) or enter static JSON manually.
Operation
Choose whether you want to Stringify or Parse the input.
Stringify: Converts a JavaScript object or array into a JSON string.
Parse: Converts a JSON string into a JavaScript object or array.
Step 3. Save and Test
Save Your Configuration
Once you’ve specified the input and chosen the operation, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “JSON Processor” action processes your data as expected.
Check the Output
If Stringify was selected, the output will be a JSON-formatted string.
If Parse was selected, the output will be a structured object or array you can use in subsequent steps.
Convert HTML to DOCX
Transforms HTML content into a DOCX file.
Useful for generating downloadable documents from HTML templates or user input.
How to Configure the “Convert HTML to DOCX” Action in ZBrain Flow?
Step 1. Add the “Convert HTML to DOCX” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select Convert HTML to DOCX from the available actions.
Step 2. Configure the “Convert HTML to DOCX” Action
HTML Content
Provide the HTML code that you want to convert.
You can enter static HTML or map data from a previous step (e.g., an email template, AI-generated text, or user input).
Step 3. Save and Test
Save Your Configuration
After specifying the HTML Content, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “Convert HTML to DOCX” action successfully processes your HTML.
Check the Output
The output typically includes a DOCX file or a URL to the newly generated document.
You can use this file in subsequent steps (e.g., attaching it to an email or storing it in a database).
Convert HTML to PDF
Converts HTML content into a PDF file.
Perfect for creating invoices, reports, or printable versions of web pages.
How to Configure the “Convert HTML to PDF” Action in ZBrain Flow?
Step 1. Add the “Convert HTML to PDF” Step
Insert a New Step
In your flow, click the + button to add a new step.
Search for “Utilities”
Type “Utilities” in the search bar and select Convert HTML to PDF from the available actions.
Step 2. Configure the “Convert HTML to PDF” Action
HTML Content
Provide the HTML code that you want to convert.
You can enter static HTML or map data from a previous step (e.g., an email template, AI-generated text, or user input).
Step 3. Save and Test
Save Your Configuration
After specifying the HTML Content, click Save or Done.
Run the Flow
Trigger your flow to confirm that the “Convert HTML to PDF” action successfully processes your HTML.
Check the Output
The output typically includes a PDF file or a URL to the newly generated document.
You can use this file in subsequent steps (e.g., attaching it to an email, storing it in a database, or sending it to a printer).
Last updated