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

Handle ErrorArtifacts returned from tasks gracefully in a Pipeline/Workflow #863

Closed
1 task done
vachillo opened this issue Jun 13, 2024 · 5 comments
Closed
1 task done

Comments

@vachillo
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently, if a task in the middle of a Pipeline or Workflow returns an ErrorArtifact, the entire Structure short-circuits and ends. This can lead to a situation where the output_task output is None.

Describe the solution you'd like
I would expect more graceful handling of ErrorArtifacts returned from tasks.

  • a way to mark a Structure or individual Tasks as fail_fast = True/False to control this behavior.
  • a way to "catch" ErrorArtifacts in a Pipeline or Workflow by specifying a Task that will be run only if an ErrorArtifact gets returned

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Lines in workflow.py that cause this behavior
Lines in pipeline.py that cause this behavior

@michal-repo
Copy link
Contributor

* a way to "catch" `ErrorArtifacts` in a Pipeline or Workflow by specifying a Task that will be run only if an `ErrorArtifact` gets returned

You should be able to instruct Agent that is using these Tools to run something if Tool returns error.

Just write such instruction in Rule, take a look at this example:
https://github.com/michal-repo/griptape-answer-cache-tool/blob/d7e4afbe1e8e96452b07db2c1d22cdc89dc9b23b/examples/example.py#L41

Agent is using specific method on Tool only if conditions are met.

@vachillo
Copy link
Member Author

* a way to "catch" `ErrorArtifacts` in a Pipeline or Workflow by specifying a Task that will be run only if an `ErrorArtifact` gets returned

You should be able to instruct Agent that is using these Tools to run something if Tool returns error.

Just write such instruction in Rule, take a look at this example: https://github.com/michal-repo/griptape-answer-cache-tool/blob/d7e4afbe1e8e96452b07db2c1d22cdc89dc9b23b/examples/example.py#L41

Agent is using specific method on Tool only if conditions are met.

for an Agent, this works. however, pipelines and workflows are running Tasks directly and not passing the outputs back to the LLM. When I am constructing these two structures, I want full control over what the next step is if there is an error.

@collindutter
Copy link
Member

@vachillo can this issue be closed with the introduction of fail_fast?

@vachillo
Copy link
Member Author

  • a way to "catch" ErrorArtifacts in a Pipeline or Workflow by specifying a Task that will be run only if an ErrorArtifact gets returned

@collindutter i think this is still pending. I was working on a "branch task" to solve this, it never got over the finish line.

@collindutter
Copy link
Member

@vachillo now that #1404 is merged, can this be closed?

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

No branches or pull requests

3 participants