Skip to main content
GET
/
defend
/
{workflow_id}
/
events
/
{event_id}
Retrieve a workflow event
from deeprails import Deeprails

DEEPRAILS_API_KEY = "YOUR_API_KEY"

client = Deeprails(
    api_key=DEEPRAILS_API_KEY,
)

event_response = client.defend.retrieve_event(
    workflow_id="defend_abc123",
    event_id="wkfl_evt_def456",
)
print(event_response.improved_model_output)
{
  "event_id": "<string>",
  "workflow_id": "<string>",
  "filtered": true,
  "evaluation_id": "<string>",
  "attempt_number": 123
}
Returns details for the workflow event specified by event_id and workflow_id, including filtered status, the most recent evaluation_id, and attempt_number (the current count of improvement attempts).

The filtered field is set to true when the event fails one or more metrics on the most recent evaluation and is set to false if all metric evaluations were above their thresholds. If filtered is true, then an improvement attempt will begin immediately after evaluation concludes.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workflow_id
string
required

The ID of the workflow associated with the event.

event_id
string
required

The ID of the requested workflow event.

Response

Workflow event retrieved successfully

event_id
string
required

A unique workflow event ID.

workflow_id
string
required

Workflow ID associated with the event.

filtered
boolean

False if evaluation passed all of the guardrail metrics, True if evaluation failed any of the guardrail metrics.

evaluation_id
string

A unique evaluation ID associated with this event. Every event has one or more evaluation attempts.

attempt_number
integer

Count of improvement attempts for the event. If greater than one then all previous improvement attempts failed.

I