-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Feature/agent_framework] Adds a Search Workflow State API #284
[Feature/agent_framework] Adds a Search Workflow State API #284
Conversation
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
We can also search by workflow step, correct? So I could find matching resources for this? {
"query": {
"nested": {
"path": "resources_created",
"query": {
"bool": {
"must": [
{
"match": {
"resources_created.workflow_step_id": "workflow_step_3"
}
}
]
}
}
}
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
@dbwiddis Yes, I've tested the query you provided :
|
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
src/main/java/org/opensearch/flowframework/model/ResourceCreated.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Joshua Palis <jpalis@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for making this change
affe129
into
opensearch-project:feature/agent_framework
…h-project#284) * Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
…h-project#284) * Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
…h-project#284) * Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
…h-project#284) * Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
* Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
…h-project#284) * Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
* Modifying workflow state index mapping and resources created Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding Search workflow state API Signed-off-by: Joshua Palis <jpalis@amazon.com> * Adding rest unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Transport unit tests Signed-off-by: Joshua Palis <jpalis@amazon.com> * Moving resourceType determination outside of the resources created class Signed-off-by: Joshua Palis <jpalis@amazon.com> --------- Signed-off-by: Joshua Palis <jpalis@amazon.com>
Description
This PR modifies the workflow state system index mapping so that the
resources_created
array has a static mapping rather than just using typeobject
. This allows us to use a search query against this index for specific terms within theresources_created
object array.Additionally, this PR exposes a search API (path :
/_plugins/_flow_framework/workflow/state/_search
) against this system index which can accept OpenSearch DSL. Open to suggestions on the path if there are any concernsTesting locally, creating a workflow that creates a connector, registers a remote model and deploys :
Provisioning this workflow
OpenSearch logs show us that the steps have completed successfully and that the resources created have been updated :
Now we hit the new search API using a bool query on the
resources_created
path to find documents that have aconnector_id
resource type :Issues Resolved
#279
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.