This page is being phased out as part of our documentation reorganization.
Click this card to be redirected to the updated version with the most current information.
If you notice any discrepancies or areas needing improvement in the new documentation, please use the “Report an issue” button at the bottom of the page.
text
, links
, images
, file BLOBs
, and JSON
. You can return different types of messages through various interfaces.
By default, a tool’s output in a workflow
contains three fixed variables: files
, text
, and json
. You can return data for these three variables using the methods below.
For example, use create_image_message
to return images. Tools also support custom output variables for easier reference in workflow
.
blob
: Raw file data in bytesmeta
: File metadata. Specify mime_type
if needed, otherwise Dify uses octet/stream
as defaultjson_schema
format output variable definitions. Here’s a simple example:
output_schema
containing a name
field that can be referenced in workflow
. Note that you still need to return a variable in the tool’s implementation code for actual use, otherwise it will return None
.