Skip to content

docs: add file upload support documentation for flows#5136

Open
alex-clawd wants to merge 2 commits intomainfrom
docs/file-upload-support
Open

docs: add file upload support documentation for flows#5136
alex-clawd wants to merge 2 commits intomainfrom
docs/file-upload-support

Conversation

@alex-clawd
Copy link
Copy Markdown
Contributor

Phase 4 of File Upload Support — Docs

Documents how to use crewai-files types (ImageFile, PDFFile, etc.) in flow state for file upload support.

Changes

  • docs/en/concepts/flows.mdx — new 'File Inputs' section with examples
  • docs/en/concepts/files.mdx — enhanced 'With Flows' section with Platform integration notes

What users learn

  • How to declare file input fields in flow state
  • That CrewAI Platform automatically renders file upload dropzones
  • That API users can pass URL strings (Pydantic coerces them)
  • Available file types: ImageFile, PDFFile, TextFile, AudioFile, VideoFile, File

Part of

File upload feature — Enterprise PR #1035 → AMP PR #2584 → This docs PR

Joao Moura and others added 2 commits March 25, 2026 22:51
…with emit

When a @human_feedback decorated method with emit= is the final method in a
flow (no downstream listeners triggered), the flow's final output was
incorrectly set to the collapsed outcome string (e.g., 'approved') instead
of the method's actual return value (e.g., a state dict).

Root cause: _process_feedback() returns the collapsed_outcome string when
emit is set, and this string was being stored as the method's result in
_method_outputs.

The fix:
1. In human_feedback.py: After _process_feedback, stash the real method_output
   on the flow instance as _human_feedback_method_output when emit is set.

2. In flow.py: After appending a method result to _method_outputs, check if
   _human_feedback_method_output is set. If so, replace the last entry with
   the stashed real output and clear the stash.

This ensures:
- Routing still works correctly (collapsed outcome used for @listen matching)
- The flow's final result is the actual method return value
- If downstream listeners execute, their results become the final output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 'File Inputs' section to flows.mdx documenting:
  - Using crewai-files types (ImageFile, PDFFile, etc.) in flow state
  - CrewAI Platform (AMP) automatic file upload dropzone rendering
  - API usage with URL string coercion via Pydantic
- Update files.mdx with:
  - Example of file types in flow state
  - Note about CrewAI Platform integration for flows

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mintlify
Copy link
Copy Markdown

mintlify bot commented Mar 27, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
crewai 🟢 Ready View Preview Mar 27, 2026, 8:00 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant