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

DEEPRAILS_API_KEY = "YOUR_API_KEY"

client = Deeprails(
    api_key=DEEPRAILS_API_KEY,
)

workflow_response = client.defend.retrieve_workflow(
    workflow_id="defend_abc123"
)
print(workflow_response.status)
print(workflow_response.description)
{
  "workflow_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "improvement_action": "regenerate",
  "status": "archived",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "success_rate": 123,
  "max_retries": 123
}
Returns the configuration for the workflow specified by workflow_id including name, description, improvement_action, status, success_rate, max_retries, and timestamps.

The status field indicates whether the workflow is active and currently accepting events. If the workflow is status is archived, no events submitted for the workflow will be processed.

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 to retrieve.

Response

Workflow retrieved successfully

workflow_id
string
required

A unique workflow ID.

name
string
required

Name of the workflow.

description
string

Description for the workflow.

improvement_action
enum<string> | null

The action used to improve outputs that fail one or more guardrail metrics for the workflow events. May be regenerate, fixit, or null which represents “do nothing”. Regenerate runs the user's input prompt with minor induced variance. Fixit attempts to directly address the shortcomings of the output using the guardrail failure rationale. Do nothing does not attempt any improvement.

Available options:
regenerate,
fixit
status
enum<string>

Status of the selected workflow. May be archived or active. Archived workflows will not accept events.

Available options:
archived,
active
created_at
string<date-time>

The time the workflow was created in UTC.

modified_at
string<date-time>

The most recent time the workflow was modified in UTC.

success_rate
number

Rate of events associated with this workflow that passed evaluation.

max_retries
integer

Max. number of improvement action retries until a given event passes the guardrails.

I