Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: NEW WORKFLOW ENGINE #3160

Merged
merged 1,315 commits into from Apr 8, 2024
Merged

FEAT: NEW WORKFLOW ENGINE #3160

merged 1,315 commits into from Apr 8, 2024

Conversation

takatost
Copy link
Collaborator

@takatost takatost commented Apr 8, 2024

Introducing Dify Workflow! 🎉

The much-anticipated workflow feature is here: In a nutshell, workflow provides a visual canvas for defining complex tasks as smaller, manageable steps (nodes). This reduces reliance on prompt engineering and LLM agent capabilities, taking the stability and reproducibility of your LLM applications to the next level by letting you be in control.
There are two Workflow application types with this update:

  • Workflow App
    Targeting Automation and Batch Processing: This is ideal for translation, data analysis, content generation, email automation, and more.
    image

  • Chatflow App (A Sub-Type of Chatbot)
    For Conversational Applications: Suitable for customer service, semantic search, and more conversational apps requiring multi-step logic in crafting the response.
    Compared to the regular Workflow app type, Chatflow adds chat-specific features such as conversation history support (Memory), tagged replies, an Answer node type for streaming responses, and support for rich text and images.

    image

For more information, please visit: https://docs.dify.ai/features/workflow/introduce

Other Enhancements:

  • Optimized UI flow for app creation.

  • Conversion support from various basic application types to Workflow-based applications.

    • Basic / Expert mode Chatbot apps → Chatflow

    • Text Generator → Workflow

      image

  • Dify's official app templates are now available in self-hosted mode.

  • Support for adding descriptions to applications.

  • Support for porting applications in and out of Dify with DSL.

  • Under the hood, we also refactored the underlying execution logic of all app types for cleaner architecture and a tidier repo.

Update Guide

If you need to upgrade from 0.6.0-preview-workflow.1, you will need to connect to PostgreSQL and execute the following SQL (migration inserted in the main branch) to ensure data integrity.

ALTER TABLE dataset_keyword_tables ADD COLUMN data_source_type VARCHAR(255) NOT NULL DEFAULT 'database';
ALTER TABLE embeddings ADD COLUMN provider_name VARCHAR(40) NOT NULL DEFAULT '';
ALTER TABLE embeddings DROP CONSTRAINT embedding_hash_idx;
ALTER TABLE embeddings ADD CONSTRAINT embedding_hash_idx UNIQUE (model_name, hash, provider_name);

Docker compose deployments:

  1. Get the latest code from the main branch:

    git checkout main
    git pull origin main
  2. Go to the next step and update to the latest image:

    cd docker
    docker compose up -d
  3. We also moved the agent data within the database, Execute the below script to complete the migrate: (NEW)

    docker compose exec api flask convert-to-agent-apps

Source Code deployments:

  1. Stop API server, Worker and Web frontend Server.

  2. Get the latest code from the main branch:

    git checkout main
    git pull origin main
  3. Update Python dependencies:

    cd api
    pip install -r requirements.txt
  4. Then, let's run the migration script:

    flask db upgrade
  5. We also moved the agent data within the database, Execute the below script to complete the migrate: (NEW)

    flask convert-to-agent-apps
  6. Finally, run API server, Worker and Web frontend Server again.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. 🌊 feat:workflow Workflow related stuff. labels Apr 8, 2024
@takatost takatost merged commit 7753ba2 into main Apr 8, 2024
9 checks passed
@takatost takatost deleted the feat/workflow branch April 8, 2024 10:51
Copy link

sentry-io bot commented Apr 8, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ InvokeError: [zhipuai] Error: Error code: 400, with error text {"error":{"code":"1214","message":"top_p参数非法。请检... core.model_runtime.model_providers.__base.large... View Issue
  • ‼️ ProviderTokenNotInitError: Model gpt-3.5-turbo credentials is not initialized. core.model_manager in _fetch_credentials_from_b... View Issue
  • ‼️ AttributeError: 'NoneType' object has no attribute 'strategy' core.app.apps.agent_chat.app_runner in run View Issue
  • ‼️ TypeError: can only concatenate str (not "NoneType") to str core.app.apps.base_app_runner in _handle_invoke... View Issue
  • ‼️ AttributeError: 'DatasetRetrieval' object has no attribute 'to_dataset_retriever_tool' core.tools.tool.dataset_retriever_tool in get_d... View Issue

Did you find this useful? React with a 👍 or 👎

@MatriQ MatriQ mentioned this pull request May 19, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌊 feat:workflow Workflow related stuff. size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants