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

Add Delete Workflow API #294

Merged

Conversation

dbwiddis
Copy link
Member

Description

Adds an API to delete a workflow.

It might be a good idea to warn users about losing track of provisioned resources and allow a "force" param. However, there are many more issues associated with resources (overwriting, etc.) and I think such extra logic belongs in an overall new strategy to handle this, so for now it's just a plain vanilla delete.

Issues Resolved

Fixes #23
Part of overall meta issue #88

Interactive testing

Without feature flag enabled (note this reqiures reading the workflow_id param, see #292):

localhost:9200/_plugins/_flow_framework/workflow/foobar
{
    "error": "This API is disabled. To enable it, update the setting [plugins.flow_framework.enabled] to true."
}

Enabled feature flag but no templates created:

{
    "error": "There are no templates in the global context."
}

Create a template, id qU00aowBH9rhI2IwnrH3

Delete it:

{
    "_index": ".plugins-ai-global-context",
    "_id": "qU00aowBH9rhI2IwnrH3",
    "_version": 2,
    "result": "deleted",
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 2,
    "_primary_term": 1
}

Try to delete it again (it's not there):

{
    "_index": ".plugins-ai-global-context",
    "_id": "qU00aowBH9rhI2IwnrH3",
    "_version": 1,
    "result": "not_found",
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 3,
    "_primary_term": 1
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dbwiddis dbwiddis linked an issue Dec 14, 2023 that may be closed by this pull request
@dbwiddis dbwiddis force-pushed the delete-workflow branch 2 times, most recently from f58d539 to 2fc78a4 Compare December 15, 2023 01:24
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis merged commit fe8339b into opensearch-project:feature/agent_framework Dec 15, 2023
10 checks passed
@dbwiddis dbwiddis deleted the delete-workflow branch December 15, 2023 02:10
dbwiddis added a commit to dbwiddis/flow-framework that referenced this pull request Dec 15, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
dbwiddis added a commit to dbwiddis/flow-framework that referenced this pull request Dec 15, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
dbwiddis added a commit to dbwiddis/flow-framework that referenced this pull request Dec 15, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
dbwiddis added a commit to dbwiddis/flow-framework that referenced this pull request Dec 15, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
dbwiddis added a commit that referenced this pull request Dec 18, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
dbwiddis added a commit to dbwiddis/flow-framework that referenced this pull request Dec 18, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
dbwiddis added a commit that referenced this pull request Dec 18, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
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.

[FEATURE] Implement DELETE API for the workflow
2 participants