Create and manage AI index automations
This page is currently hidden from the documentation navigation.
The following Context Engine pages are live:
Automations generate and refresh Knowledge Indicators (KIs) from an AI index's sources. Context Engine runs each automation as an Elastic workflow. You can have Elastic Agent Builder propose and pilot one, author one in the Workflows UI, or manage workflows and their AI index associations programmatically.
You need a custom AI index with at least one source, the All privilege for the Context Engine feature, and permission to create and manage workflows. To use the guided route, you also need access to Elastic Agent Builder and permission to run workflows.
Decide what each KI should represent before creating an automation. Refer to Select a generation strategy and Design useful Knowledge Indicators.
Use the guided route to have Elastic Agent Builder propose, pilot, and save a workflow for the AI index:
- Open Context, then select the AI index.
- In Automations, select Suggest automation.
- Elastic Agent Builder opens a new conversation and sends a request to suggest an automation for the AI index.
- Review the proposed generation strategy, source coverage, KI content, and verification plan.
- Ask for changes where necessary, then confirm that Elastic Agent Builder should build and pilot the workflow.
- Review the pilot summary and temporary KI output.
- Tell Elastic Agent Builder to save the automation.
- Return to the AI index and confirm that the saved workflow appears in Automations.
The pilot can create and delete temporary KIs while testing the workflow. Focus your review on the source data it reads, what each KI represents, the claims and query guidance it generates, and the checks it performs before writing a KI. You do not need to understand every line of the generated YAML.
Use the manual route when you intend to author the workflow yourself:
- Open the AI index and select Create automation.
- Context Engine creates and attaches a workflow with Enabled turned off, then opens it in the Workflows YAML editor.
- Replace the generic starter workflow with the trigger and steps that generate the intended KIs.
- Include the appropriate Context Engine workflow steps to create, update, verify, or delete KIs.
- Test the workflow, review its output, then save it.
- Return to the AI index and confirm that the workflow appears in Automations.
For YAML editing and test runs, refer to Use the YAML editor.
The AI index lists each attached workflow and whether it is enabled.
To inspect or edit one:
- Open the AI index.
- In Automations, use the preview action to inspect the workflow YAML without leaving the page.
- Select Edit workflow to open it in the Workflows editor.
- Make and test the required changes, then save the workflow.
Saving a workflow creates a versioned snapshot. For information about comparing or restoring versions, refer to Workflow version history.
Operate an automation from the Workflows UI:
- Run the workflow manually to generate or refresh KIs immediately.
- Add a scheduled trigger when its KIs must refresh automatically.
- Monitor the execution and inspect the inputs, outputs, and errors for each step.
- Use the Enabled toggle to control whether the workflow responds to its configured triggers.
After a successful run, return to the AI index's Knowledge Indicators tab and confirm that the expected KIs were created or updated.
Removing an automation from an AI index detaches its workflow. It does not delete the workflow itself.
Detach an automation as follows:
- Open the AI index.
- In Automations, select Edit.
- Remove the automation, then select Save.
- Confirm that it no longer appears in the AI index.
To delete the detached workflow, delete it separately from the Workflows UI. You can also choose to delete attached automations when you delete the AI index.
Use the Workflows APIs together with the Context Engine APIs when you need to provision or operate automations programmatically:
Create the workflow with the create workflow API, or modify an existing workflow with the update workflow API. Use the get workflow API to retrieve its current definition before changing it.
Attach the workflow by adding its ID to the AI index's
automationsarray with the create or update AI index API:{ "automations": [ { "type": "workflow", "value": "my-workflow-id" } ] }Run it with the run workflow API, or enable its configured trigger. Use the get workflow executions API to inspect its runs.
To detach it, remove its entry from the AI index's
automationsarray. To remove the workflow itself, use the delete workflow API separately.
Updating an AI index replaces its complete record. For an example that preserves the other fields, refer to Update an AI index with the API.