Skip to main content
This guide will teach you how to build reusable workflows (tools) in Runchat. You will create a tool for describing the aesthetic of collections of images. This is a useful technique for reproducing the style and content of reference imagery for design exploration.
Before starting this guide, complete the first tutorial on Creating a Workflow.

Creating a descriptive prompt

Open the Runchat editor and click Blank canvas in the examples browser to create a new workflow. Double-click the canvas, type agent, and add an Agent node. Enter the following in its prompt:
This prompt can be improved, but it works reasonably well for most use cases. Let’s try it out with some images.

Importing images

Three image inputs connected to the Context of an Agent node with the describe prompt
Let’s bring some images into Runchat to describe with our Agent node. There are several ways to import images into Runchat:
  • Clicking + next to the agent composer and choosing Upload
  • Entering a URL to an image in a text input
  • Dragging and dropping an image file from your computer onto the canvas
  • Copying an image to the clipboard and pasting it onto the canvas
  • Taking a screenshot and pasting it onto the canvas
  • Asking the agent to search the web for images
Head to your favourite source of inspiration (Pinterest, Instagram, Google Images, blogs etc.) and import 3 images with an aesthetic you’re interested in. This tool will work better if all images have a similar aesthetic, but this is not essential. Connect all of your images to the Context input of the Agent node.
Images you upload and generate are saved to your Gallery. If you need to work with private images, subscribe to a Pro Plan.

Merging data

The list-handling chip on the Context row, showing Each (3 in, 3 runs) and All (3 in, 1 run)
In the last tutorial we saw that connecting multiple inputs to a parameter will cause a node to run multiple times. This is useful for running parts of workflows in parallel, for instance to generate multiple variations on images or to process multiple documents at once. In this particular case, we don’t want to describe “each” individual image, we want to describe the aesthetic of all of the images together. When a list is connected to an input, the input row shows a list-handling chip. The Agent’s Context input is already set to All, so the prompt receives every connected image at once. Click the chip to see the options: each shows how many runs it produces, so All reads “3 in, 1 run” and Each reads “3 in, 3 runs”. Click Run in the Agent node’s header to see the resulting description.
The Agent node returning a single detailed prompt describing all three images

Choosing inputs and outputs

Every workflow in Runchat can be published as a tool to be re-used in other workflows, attached to an Agent node, or found and run by the agent. To publish a tool, we need to specify which inputs we want to receive data, and which outputs we want to return data. When we publish an input or output, its UI is used to build the tool’s node or app, and all other inputs and outputs are hidden. Before publishing a tool, delete any nodes that will not be directly necessary to generate the output. We will use a single image input as our tool input. This means the image picker becomes our tool UI. Keep one of your imported images and delete all of the rest. Give the workflow the name the tool will use: click the workflow name in the top-left, choose Rename, and enter Describe Images. Click an empty part of the canvas so that no nodes are selected, then open the title menu again and choose Publish app or tool. The Publish panel opens on the right. While it is open, every parameter handle on the canvas shows a puzzle piece icon.
  1. Hover over the output handle of your image and click its puzzle piece. The icon fills in and the image appears in the Publish panel.
  2. In the panel, rename the parameter to images so language models (and people) know what to connect.
  3. Hover over the Result output handle on the Agent node and click its puzzle piece to publish the description.
With nodes selected, the Publish panel publishes just those nodes as a new tool. With nothing selected, it releases a new version of the whole workflow. This guide publishes the whole workflow.

Publishing the tool

The Publish panel shows your published inputs and outputs exactly as a user of the tool will see them. Published tools can also power web Apps: custom front-ends anyone can use without opening the editor. At the bottom of the panel, describe what the tool does, for example “Describes the shared aesthetic of a collection of images as a detailed image prompt”. The agent reads this description to decide when to use your tool, so make it specific. The footer also shows an estimate of what each run costs. Click Publish v1. You can close the panel with the X in its header.
You can publish a new version of your tool at any time. Each release is a new version of the same tool.
To learn more check out the Apps page

Adding the tool to your nodes

To add your tool from the node picker, add it to your nodes:
  1. Open the title menu and choose Back to dashboard.
  2. In Workflows, open the menu on your Describe Images workflow and choose Add to my nodes.
Your tool now appears under Tools in the node picker of every workflow.

Using tools in workflows

Runchat can automate complex, process-specific workflows by giving language models access to custom tools you have created. Create a new workflow from the title menu with New workflow, then click Blank canvas.
  1. Double-click the canvas, search for Flux 2 Klein, and add it. With the node selected, set the variations control on its toolbar to 2 images.
  2. Double-click the canvas again and search for Describe Images, or open Tools in the picker. Click your tool to add it.
  3. Connect the tool’s output to the prompt input of your image node.
  4. Drop in some images and connect them to the tool’s images input to replace the default image saved in the tool.
  5. Select the nodes, then click Run in the selection bar.
This describes our images, creates a prompt, and uses this prompt to generate two new high quality images in a similar style.
After your Describe Images node has run, open More (…) on its toolbar and choose Expand workflow to show all nodes in the tool and their inputs and outputs during the last run.
A description chained into a second Agent that adds design intent, feeding an image node
You can chain multiple prompts together to customize your image descriptions and add more design intent. For instance, you could take the output of your Describe Images tool, connect it to the Context of an Agent node, and then write a prompt that provides instructions for things to add. This is useful for controlling and directing the content.

Tool calling

Any workflow you publish can be used as a tool in another workflow, by an Agent node, or by the agent.
  • The agent searches for and uses the tools it needs on its own. Add some images to the canvas, select them, and ask the agent to describe their aesthetic with your Describe Images tool. If the agent needs permission to run it, it shows a Permission needed card.
  • An Agent node can call tools you attach to it. Select the node, click Tools on its toolbar, and choose your tool.
Tools are especially useful for searching the internet and making requests to external resources like databases or third-party APIs. You can build tools in Runchat for searching the web, reading and writing to spreadsheets, sending emails and just about anything else that you can think of.

Next steps

You’ve now covered the basics of Runchat, but there’s a lot more it can do. Check out the concepts guides to get a better understanding of how Runchat works under the hood.
  • Publishing tools: versions, sharing and descriptions
  • Apps: build a web front-end that runs your tools
  • Examples: worked recipes for rendering, scripting and more