Skip to content

fix: save flow plot HTML to current working directory instead of temp directory#5016

Open
r266-tech wants to merge 1 commit intocrewAIInc:mainfrom
r266-tech:fix/flow-plot-saves-to-cwd
Open

fix: save flow plot HTML to current working directory instead of temp directory#5016
r266-tech wants to merge 1 commit intocrewAIInc:mainfrom
r266-tech:fix/flow-plot-saves-to-cwd

Conversation

@r266-tech
Copy link
Copy Markdown

@r266-tech r266-tech commented Mar 22, 2026

Fixes #4991

Problem

When running crewai flow plot, the framework generates the HTML visualization inside a hidden system temporary directory instead of the user's current working directory.

The CLI outputs a misleading message: Flow visualization saved to guide_creator_flow.html, leading users to believe the file was saved locally when it was not.

Solution

Modified render_interactive() in crewai/flow/visualization/renderers/interactive.py to save files in the current working directory instead of creating a temporary directory.

Changes

  • Changed tempfile.mkdtemp() to Path.cwd() for output directory
  • Updated docstring to reflect the new behavior
  • Removed unused tempfile import

Testing

The existing test test_visualization_plot_method() passes with this change. Files are now correctly saved where users expect them.


Note

Medium Risk
Changes where crewai flow plot writes files, which can affect user workflows and may overwrite existing files or fail under restricted permissions. Logic is small and localized to the interactive renderer.

Overview
Flow interactive plot output is now written to the current working directory rather than a generated temp directory, so crewai flow plot leaves the HTML/CSS/JS artifacts alongside the user’s project.

render_interactive() was updated to use Path.cwd() for output_dir, and its docstring/return description were adjusted accordingly; the unused tempfile dependency was removed.

Written by Cursor Bugbot for commit abdfad7. This will update automatically on new commits. Configure here.

… directory

Fixes crewAIInc#4991. Modified render_interactive() to save files in the current working directory instead of creating a temporary directory.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

This PR is stale because it has been open for 45 days with no activity.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] crewai flow plot saves HTML to a hidden temp directory instead of the current working directory (despite CLI message)

1 participant