Notes action steps

Notes action steps let workflows create, read, update, and delete notes on alerts, attacks, and other Elasticsearch documents in Elastic Security. Use these named steps instead of a generic kibana.request call to the notes API.

Use notes steps for patterns like:

  • Write an AI classification verdict to the alert it analyzed.
  • Add the same triage note to every alert a workflow closes.
  • Check whether an alert already has a note before writing one.

All four notes steps share the same conventions.

Privileges. The user whose privileges authorize the run needs the Notes feature privilege under Security in Kibana: Read for security.getNotes, and All for the other three steps. To find out which user that is, refer to Whose privileges authorize a run.

All parameters live under with.

Notes attach to a document by its Elasticsearch _id. document_id is the _id of an alert, an attack, or any other document, so one step covers every object type. These steps don't create or manage Timeline notes.

Markdown and length. The text of a note supports Markdown and can be up to 60,000 characters. A document can carry up to 100 notes, so a workflow that creates notes in a loop might reach that limit.

Chain steps with note_id. Step outputs use snake_case field names. Use steps.<name>.output.note_id from security.createNote, or foreach.item.note_id over security.getNotes output, in a later update or delete step.

Parameter names differ between steps. security.createNote and security.getNotes take document_id. security.updateNote takes note_id, document_id, and text. security.deleteNote takes ids, which accepts one note ID or an array.

Schema convention. In each schema table on this page, the Location column indicates where each parameter sits in the YAML:

  • top level: Alongside type and name, at the top of the step or trigger definition.
  • `with`: Inside the step's with: block.
  • `on`: Inside the trigger's on: block.

Jump to any step:

security.createNote · security.getNotes · security.updateNote · security.deleteNote


Create a note on an alert, attack, or document. The returned note_id identifies the note in later update or delete steps.

Parameter Location Type Required Description
text with string Yes The note text. Supports Markdown. 1 to 60,000 characters.
document_id with string Yes The Elasticsearch _id of the alert, attack, or document to attach the note to.

The step returns { success: boolean, note_id: string, message: string }. note_id and message are present when the step succeeds.

- name: create_note
  type: security.createNote
  with:
    text: "{{ steps.generate_summary.output.summary }}"
    document_id: "{{ event.alerts[0]._id }}"
		

Retrieve every note attached to an alert, attack, or document.

Parameter Location Type Required Description
document_id with string Yes The Elasticsearch _id of the alert, attack, or document.

The step returns { success: boolean, total_count: number, notes: array }. Each entry in notes has note_id, text, document_id, timeline_id, created_by, created, updated_by, updated, and version. The created and updated values are Unix epoch timestamps in milliseconds. Any field might be null.

- name: get_notes
  type: security.getNotes
  with:
    document_id: "{{ event.alerts[0]._id }}"

- name: print_notes
  type: foreach
  foreach: "${{ steps.get_notes.output.notes }}"
  steps:
    - name: print_note
      type: console
      with:
        message: "Note {{ foreach.item.note_id }}: {{ foreach.item.text }}"
		

Replace the text of an existing note. The note keeps its document and its Timeline association if it has one. The step fails if the note isn't on the given document.

Parameter Location Type Required Description
note_id with string Yes The ID of the note to update.
document_id with string Yes The Elasticsearch _id of the alert, attack, or document that holds the note.
text with string Yes The new note text. Replaces the existing text. Supports Markdown. 1 to 60,000 characters.

The step returns { success: boolean, note_id: string, message: string }. note_id and message are present when the step succeeds.

- name: update_note
  type: security.updateNote
  with:
    note_id: "{{ steps.create_note.output.note_id }}"
    document_id: "{{ event.alerts[0]._id }}"
    text: "Updated with enrichment findings: {{ steps.enrich.output.summary }}"
		

Delete one or more notes by note ID. Unlike the other notes steps, this step doesn't take a document_id.

Parameter Location Type Required Description
ids with string \| string[] Yes One note ID, or an array of note IDs.

The step returns { success: boolean, message: string }. The message includes the number of deleted notes.

- name: list_notes
  type: security.getNotes
  with:
    document_id: "{{ event.alerts[0]._id }}"

- name: delete_notes
  type: security.deleteNote
  with:
    ids: "${{ steps.list_notes.output.notes | map: 'note_id' }}"