| layout | default |
|---|---|
| title | Workflow templates |
| nav_order | 25 |
OpenSearch provides several workflow templates for some common machine learning (ML) use cases. Using a template simplifies complex setups and provides many default values for use cases like semantic or conversational search.
You can specify a workflow template when you call the Create Workflow API:
-
To use an OpenSearch-provided workflow template, specify the template use case as the
use_casequery parameter (see the Example). For a list of OpenSearch-provided templates, see Supported workflow templates. -
To use a custom workflow template, provide the complete template in the request body. For an example of a custom template, see an example JSON template or an example YAML template.
To provision the workflow, specify provision=true as a query parameter.
In this example, you'll configure the semantic_search_with_cohere_embedding_query_enricher workflow template. The workflow created using this template performs the following configuration steps:
- Deploys an externally hosted Cohere model
- Creates an ingest pipeline using the model
- Creates a sample vector index and configures a search pipeline to define the default model ID for that index
Send the following request to create and provision a workflow using the semantic_search_with_cohere_embedding_query_enricher workflow template. The only required request body field for this template is the API key for the Cohere Embed model:
POST /_plugins/_flow_framework/workflow?use_case=semantic_search_with_cohere_embedding_query_enricher&provision=true
{
"create_connector.credential.key" : "<YOUR API KEY>"
}{% include copy-curl.html %}
OpenSearch responds with a workflow ID for the created workflow:
{
"workflow_id" : "8xL8bowB8y25Tqfenm50"
}The workflow in the previous step creates a default vector index. The default index name is my-nlp-index:
{
"create_index.name": "my-nlp-index"
}For all default parameter values for this workflow template, see Cohere Embed semantic search defaults.
To ingest documents into the index created in the previous step, send the following request:
PUT /my-nlp-index/_doc/1
{
"passage_text": "Hello world",
"id": "s1"
}{% include copy-curl.html %}
To perform a vector search on your index, use a neural query clause:
GET /my-nlp-index/_search
{
"_source": {
"excludes": [
"passage_embedding"
]
},
"query": {
"neural": {
"passage_embedding": {
"query_text": "Hi world",
"k": 100
}
}
}
}{% include copy-curl.html %}
Each workflow template has a defined schema and a set of APIs with predefined default values for each step. For more information about template parameter defaults, see Supported workflow templates.
To override a template's default values, provide the new values in the request body when sending a create workflow request. For example, the following request changes the Cohere model, the name of the text_embedding processor output field, and the name of the sparse index of the semantic_search_with_cohere_embedding template:
POST /_plugins/_flow_framework/workflow?use_case=semantic_search_with_cohere_embedding
{
"create_connector.model" : "embed-multilingual-v3.0",
"text_embedding.field_map.output": "book_embedding",
"create_index.name": "sparse-book-index"
}{% include copy-curl.html %}
The workflow you created provisioned all the necessary resources for semantic search. To view the provisioned resources, call the Get Workflow Status API and provide the workflowID for your workflow:
GET /_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50/_status{% include copy-curl.html %}
To use a workflow template, specify it in the use_case query parameter when creating a workflow. The following templates are supported:
The following templates are supported:
- Model deployment templates:
- Semantic search templates:
- Neural sparse search templates:
- Multimodal search templates:
- Hybrid search templates:
- Conversational search templates:
- Agentic search templates:
The following workflow templates configure model deployment.
This workflow creates and deploys an Amazon Bedrock embedding model (by default, titan-embed-text-v1).
- Use case:
bedrock_titan_embedding_model_deploy - Created components: A connector and model for the Amazon Bedrock Titan embeddings model
- Required parameters:
create_connector.credential.access_keycreate_connector.credential.secret_keycreate_connector.credential.session_token
- Defaults
Note: Requires AWS credentials and access to Amazon Bedrock.
This workflow creates and deploys an Amazon Bedrock multimodal embedding model (by default, titan-embed-image-v1).
- Use case:
bedrock_titan_multimodal_model_deploy - Created components: A connector and model for Amazon Bedrock Titan multimodal embeddings
- Required parameters:
create_connector.credential.access_keycreate_connector.credential.secret_keycreate_connector.credential.session_token
- Defaults
Note: Requires AWS credentials and access to Amazon Bedrock.
This workflow creates and deploys a Cohere embedding model (by default, embed-english-v3.0).
- Use case:
cohere_embedding_model_deploy - Created components: A connector and model for Cohere embedding
- Required parameters:
create_connector.credential.key
- Defaults
Note: Requires a Cohere API key.
This workflow creates and deploys a Cohere chat model (by default, Cohere Command).
- Use case:
cohere_chat_model_deploy - Created components: A connector and model for Cohere chat
- Required parameters:
create_connector.credential.key
- Defaults
Note: Requires a Cohere API key.
This workflow creates and deploys an OpenAI embedding model (by default, text-embedding-ada-002).
- Use case:
open_ai_embedding_model_deploy - Created components: A connector and model for OpenAI embeddings
- Required parameters:
create_connector.credential.key
- Defaults
Note: Requires an OpenAI API key.
This workflow creates and deploys an OpenAI chat model (by default, gpt-3.5-turbo).
- Use case:
openai_chat_model_deploy - Created components: A connector and model for OpenAI chat
- Required parameters:
create_connector.credential.key
- Defaults
Note: Requires an OpenAI API key.
The following workflow templates configure semantic search.
This workflow configures semantic search.
- Use case:
semantic_search - Created components:
- An ingest pipeline with a
text_embeddingprocessor - A vector index configured with the pipeline
- An ingest pipeline with a
- Required parameters:
create_ingest_pipeline.model_id: The model ID of the text embedding model to be used
- Defaults
This workflow configures semantic search with a default model for neural queries.
- Use case:
semantic_search_with_query_enricher - Created components:
- An ingest pipeline with a
text_embeddingprocessor - A vector index configured with the pipeline
- A
query_enrichersearch processor that sets a default model ID for neural queries.
- An ingest pipeline with a
- Required parameters:
create_ingest_pipeline.model_id: The model ID of the text embedding model to be used
- Defaults
This workflow configures semantic search and deploys a pretrained model.
- Use case:
semantic_search_with_local_model - Created components:
- A pretrained model (by default,
huggingface/sentence-transformers/paraphrase-MiniLM-L3-v2) - An ingest pipeline with a
text_embeddingprocessor - A vector index configured with the pipeline
- A
query_enrichersearch processor that sets a default model ID for neural queries.
- A pretrained model (by default,
- Required parameters: None
- Defaults
Note: Uses a local pretrained model with a default configuration.
This workflow configures semantic search and deploys a Cohere embedding model.
- Use case:
semantic_search_with_cohere_embedding - Created components:
- A Cohere embedding model (by default,
embed-english-v3.0) connector and deployment - An ingest pipeline with a
text_embeddingprocessor - A vector index configured with the pipeline
- A Cohere embedding model (by default,
- Required parameters:
create_connector.credential.key: API key for the Cohere model
- Defaults
Note: Requires a Cohere API key.
This workflow configures semantic search, deploys a Cohere embedding model, and adds a query enricher search processor.
- Use case:
semantic_search_with_cohere_embedding_query_enricher - Created components:
- A Cohere embedding model connector and deployment
- An ingest pipeline with a
text_embeddingprocessor - A vector index configured with the pipeline
- A
query_enrichersearch processor that sets a default model ID for neural queries.
- Required parameters:
create_connector.credential.key: API key for the Cohere model
- Defaults
Note: Requires a Cohere API key.
This workflow configures semantic search with a Cohere embedding model and reindexes an existing index.
- Use case:
semantic_search_with_reindex - Created components:
- A Cohere embedding model connector and deployment
- A vector index configured with the pipeline
- A reindexing process
- Required parameters:
create_connector.credential.key: API key for the Cohere modelreindex.source_index: The source index to be reindexed
- Defaults
Note: Reindexes a source index into a newly configured k-NN index using a Cohere embedding model.
The following workflow template configures neural sparse search.
This workflow configures neural sparse search.
- Use case:
local_neural_sparse_search_bi_encoder - Created components:
- A locally hosted pretrained sparse encoding model (by default,
amazon/neural-sparse/opensearch-neural-sparse-encoding-v1) - An ingest pipeline with a
sparse_encodingprocessor - A vector index configured with the pipeline
- A locally hosted pretrained sparse encoding model (by default,
- Required parameters: None
- Defaults
The following workflow templates configure multimodal search.
This workflow configures multimodal search.
- Use case:
multimodal_search - Created components:
- An ingest pipeline with a
text_image_embeddingprocessor - A vector index configured with the pipeline
- An ingest pipeline with a
- Required parameters:
create_ingest_pipeline.model_id: The model ID of the multimodal embedding model to be used
- Defaults
This workflow deploys an Amazon Bedrock multimodal model and configures a multimodal search pipeline.
- Use case:
multimodal_search_with_bedrock_titan - Created components:
- An Amazon Bedrock Titan multimodal embedding model connector and deployment
- An ingest pipeline with a
text_image_embeddingprocessor - A vector index for multimodal search configured with the pipeline
- Required parameters:
create_connector.credential.access_keycreate_connector.credential.secret_keycreate_connector.credential.session_token
- Defaults
Note: Requires AWS credentials and access to Amazon Bedrock.
The following workflow templates configure hybrid search.
This workflow configures hybrid search.
- Use case:
hybrid_search - Created components:
- An ingest pipeline
- A vector index configured with the pipeline
- A search pipeline with a
normalization_processor
- Required parameters:
create_ingest_pipeline.model_id: The model ID of the text embedding model to be used
- Defaults
This workflow configures hybrid search and deploys a pretrained model.
- Use case:
hybrid_search_with_local_model - Created components:
- A pretrained model (by default,
huggingface/sentence-transformers/paraphrase-MiniLM-L3-v2) - An ingest pipeline
- A vector index configured with the pipeline
- A search pipeline with a
normalization_processor
- A pretrained model (by default,
- Required parameters: None
- Defaults
Note: Uses a local pretrained model for hybrid search configuration.
The following workflow template configures conversational search with RAG.
This workflow deploys a large language model and configures a conversational search pipeline.
- Use case:
conversational_search_with_llm_deploy - Created components:
- A chat model (by default, Cohere Command) connector and deployment
- A search pipeline with a
retrieval_augmented_generationprocessor
- Required parameters:
create_connector.credential.key: API key for the LLM
- Defaults
Note: Requires an API key for the chosen language model.
The following workflow templates configure agentic search.
This workflow deploys an Amazon Bedrock chat model and configures an agentic search pipeline using a flow agent.
- Use case:
agentic_search_with_flow_agent - Created components:
- An Amazon Bedrock connector and a remote chat model (by default, Claude 4 Sonnet)
- A
QueryPlanningTool - A flow agent wired to the
QueryPlanningTool - A search pipeline with an
agentic_query_translatorrequest processor and anagentic_contextresponse processor
- Required parameters:
create_connector.credential.access_keycreate_connector.credential.secret_keycreate_connector.credential.session_token
- Defaults
Note: Requires AWS credentials and access to Amazon Bedrock.
This workflow deploys an Amazon Bedrock chat model and configures an agentic search pipeline using a conversational agent with conversation memory and multiple tools.
- Use case:
agentic_search_with_conversational_agent - Created components:
- An Amazon Bedrock connector and a remote chat model (by default, Claude 4 Sonnet)
- A
QueryPlanningTool,ListIndexTool, andIndexMappingTool - A conversational agent with conversation memory and all three tools
- A search pipeline with an
agentic_query_translatorrequest processor and anagentic_contextresponse processor
- Required parameters:
create_connector.credential.access_keycreate_connector.credential.secret_keycreate_connector.credential.session_token
- Defaults
Note: Requires AWS credentials and access to Amazon Bedrock.