Replies: 1 comment 3 replies
-
|
Dify workflows don't natively support passing the Dify Extractor's "images" output as a selectable variable in downstream nodes like Iteration or Code Execution. This is because the workflow engine only recognizes certain types (string, number, array[file]), and "images" is output as an array of objects, not as files or a supported type, so it doesn't show up as an option in those nodes reference. To work around this, you can add a Template node right after the Dify Extractor. In the Template node, use Jinja2 to format the images array into a JSON string, like this: [
{% for image in extractor.images %}
{
"mime_type": "{{ image.mime_type }}",
"name": "{{ image.name }}",
"preview_url": "{{ image.preview_url }}",
"size": {{ image.size }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]Then, add a Parameter Extractor (JSON parser) node to parse this string into an array. Now you can connect the output to an Iteration node, and each image object will be available as This approach is the recommended way to handle image outputs in Dify workflows until native support for image/object types is added. If you need to process the actual image files, check if they are included in the To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
In Dify Workflow, I added a "Dify Extractor" and uploaded a Word document that contains images.
In the "Output" section, I can see options like document, file, image, etc.
However, when I try to use an "Iteration" or "Code Execution" node, I can only see options like file, json, etc.—but not image.

2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions