{ "workflow_id": "defend_abc123", "name": "Test Workflow", "description": "A workflow used to test the DeepRails API", "status": "active", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "threshold_type": "custom", "automatic_hallucination_tolerance_levels": null, "custom_hallucination_threshold_values": { "correctness": 0.9 }, "events": [ { "event_id": "evt_xxxxxxxxxxxx", "status": "completed", "improvement_tool_status": "improved", "improved_model_output": "Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.", "billing_request_id": "bill_0123456789abcdefabcd", "evaluations": [ { "attempt": "Initial Evaluation", "evaluation_status": "completed", "improvement_tool_status": "improvement_required", "analysis_of_failures": "The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.", "key_improvements": [ "Added a brief qualifier to the sentence to make it more accurate.", "Added a more detailed explanation of the differences between mitosis and meiosis." ], "guardrail_metrics": [ "completeness", "instruction_adherence" ], "run_mode": "precision", "model_input": { "system_prompt": "You are a helpful tutor specializing in AP science classes.", "user_prompt": "Explain the difference between mitosis and meiosis in one sentence.", "context": [ { "role": "user", "content": "I have an AP Bio exam tomorrow, can you help me study?" }, { "role": "tutor", "content": "Sure, I'll help you study." } ] }, "model_output": "Mitosis creates haploid gametes for reproduction, while meiosis produces identical diploid cells for growth.", "nametag": "Test", "progress": 100, "error_message": null, "evaluation_result": { "completeness": { "score": 0.6, "rationale": "The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.", "threshold": 0.8 }, "instruction_adherence": { "score": 0.25, "rationale": "The response does not highlight the key differences between mitosis and meiosis.", "threshold": 0.8 } }, "evaluation_total_cost": 0.01, "created_at": "2025-11-10T01:32:44.591Z" }, { "attempt": "Improvement Attempt 1", "evaluation_status": "completed", "improvement_tool_status": "improved", "analysis_of_failures": "null,", "key_improvements": "null,", "guardrail_metrics": [ "completeness", "instruction_adherence" ], "run_mode": "precision", "model_input": { "system_prompt": "You are a helpful tutor specializing in AP science classes.", "user_prompt": "Explain the difference between mitosis and meiosis in one sentence.", "context": [ { "role": "user", "content": "I have an AP Bio exam tomorrow, can you help me study?" }, { "role": "tutor", "content": "Sure, I'll help you study." } ] }, "model_output": "Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.", "nametag": "Test", "progress": 100, "error_message": null, "evaluation_result": { "completeness": { "score": 0.89, "rationale": "The sentence is concise, relevant, and well-structured, and it covers the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer. However, it overgeneralizes and makes unqualified universal claims: stating mitosis produces 'diploid' cells and meiosis produces 'four ... gametes' can be inaccurate in some biological contexts (e.g., mitosis in haploid cells or organisms, and oogenesis producing one functional ovum plus polar bodies). To make the sentence both accurate and still compact, add brief qualifiers—for example: 'In diploid organisms, mitosis produces two genetically similar diploid daughter cells for growth and repair, whereas meiosis involves two divisions that typically yield four genetically varied haploid cells (gametes), although in female animals often only one functional gamete results.' This preserves brevity while removing the main factual overgeneralizations.", "threshold": 0.8 }, "instruction_adherence": { "score": 1, "rationale": "The response exemplary meets the explicit instructions by delivering a single, well-formed sentence that clearly contrasts mitosis and meiosis using key distinguishing features (cell number, genetic identity/variation, ploidy, and biological purpose), showing concise and accurate adherence to the prompt.", "threshold": 0.8 } }, "evaluation_total_cost": 0.01, "created_at": "2025-11-10T01:32:44.591Z", "modified_at": "2025-11-10T01:32:44.591Z" } ] } ], "capabilities": [ { "capability": "web_search" }, { "capability": "file_search" }, { "capability": "context_awareness" } ], "files": [ { "file_name": "example.pdf", "file_id": "file_xxxxxxxxxxxx", "file_size": 1024, "presigned_url": "https://deeprails.com/files/example.pdf", "presigned_url_expires_at": "2025-11-10T01:32:44.591Z" } ], "improvement_action": "fixit", "stats": { "outputs_processed": 1, "outputs_below_threshold": 0, "outputs_improved": 0 }}
Defend
Retrieve a Workflow's Details
Use this endpoint to retrieve the details for a specific defend workflow
{ "workflow_id": "defend_abc123", "name": "Test Workflow", "description": "A workflow used to test the DeepRails API", "status": "active", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "threshold_type": "custom", "automatic_hallucination_tolerance_levels": null, "custom_hallucination_threshold_values": { "correctness": 0.9 }, "events": [ { "event_id": "evt_xxxxxxxxxxxx", "status": "completed", "improvement_tool_status": "improved", "improved_model_output": "Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.", "billing_request_id": "bill_0123456789abcdefabcd", "evaluations": [ { "attempt": "Initial Evaluation", "evaluation_status": "completed", "improvement_tool_status": "improvement_required", "analysis_of_failures": "The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.", "key_improvements": [ "Added a brief qualifier to the sentence to make it more accurate.", "Added a more detailed explanation of the differences between mitosis and meiosis." ], "guardrail_metrics": [ "completeness", "instruction_adherence" ], "run_mode": "precision", "model_input": { "system_prompt": "You are a helpful tutor specializing in AP science classes.", "user_prompt": "Explain the difference between mitosis and meiosis in one sentence.", "context": [ { "role": "user", "content": "I have an AP Bio exam tomorrow, can you help me study?" }, { "role": "tutor", "content": "Sure, I'll help you study." } ] }, "model_output": "Mitosis creates haploid gametes for reproduction, while meiosis produces identical diploid cells for growth.", "nametag": "Test", "progress": 100, "error_message": null, "evaluation_result": { "completeness": { "score": 0.6, "rationale": "The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.", "threshold": 0.8 }, "instruction_adherence": { "score": 0.25, "rationale": "The response does not highlight the key differences between mitosis and meiosis.", "threshold": 0.8 } }, "evaluation_total_cost": 0.01, "created_at": "2025-11-10T01:32:44.591Z" }, { "attempt": "Improvement Attempt 1", "evaluation_status": "completed", "improvement_tool_status": "improved", "analysis_of_failures": "null,", "key_improvements": "null,", "guardrail_metrics": [ "completeness", "instruction_adherence" ], "run_mode": "precision", "model_input": { "system_prompt": "You are a helpful tutor specializing in AP science classes.", "user_prompt": "Explain the difference between mitosis and meiosis in one sentence.", "context": [ { "role": "user", "content": "I have an AP Bio exam tomorrow, can you help me study?" }, { "role": "tutor", "content": "Sure, I'll help you study." } ] }, "model_output": "Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.", "nametag": "Test", "progress": 100, "error_message": null, "evaluation_result": { "completeness": { "score": 0.89, "rationale": "The sentence is concise, relevant, and well-structured, and it covers the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer. However, it overgeneralizes and makes unqualified universal claims: stating mitosis produces 'diploid' cells and meiosis produces 'four ... gametes' can be inaccurate in some biological contexts (e.g., mitosis in haploid cells or organisms, and oogenesis producing one functional ovum plus polar bodies). To make the sentence both accurate and still compact, add brief qualifiers—for example: 'In diploid organisms, mitosis produces two genetically similar diploid daughter cells for growth and repair, whereas meiosis involves two divisions that typically yield four genetically varied haploid cells (gametes), although in female animals often only one functional gamete results.' This preserves brevity while removing the main factual overgeneralizations.", "threshold": 0.8 }, "instruction_adherence": { "score": 1, "rationale": "The response exemplary meets the explicit instructions by delivering a single, well-formed sentence that clearly contrasts mitosis and meiosis using key distinguishing features (cell number, genetic identity/variation, ploidy, and biological purpose), showing concise and accurate adherence to the prompt.", "threshold": 0.8 } }, "evaluation_total_cost": 0.01, "created_at": "2025-11-10T01:32:44.591Z", "modified_at": "2025-11-10T01:32:44.591Z" } ] } ], "capabilities": [ { "capability": "web_search" }, { "capability": "file_search" }, { "capability": "context_awareness" } ], "files": [ { "file_name": "example.pdf", "file_id": "file_xxxxxxxxxxxx", "file_size": 1024, "presigned_url": "https://deeprails.com/files/example.pdf", "presigned_url_expires_at": "2025-11-10T01:32:44.591Z" } ], "improvement_action": "fixit", "stats": { "outputs_processed": 1, "outputs_below_threshold": 0, "outputs_improved": 0 }}
Workflows will eventually contain many events, each with its own set of evaluations and improvement attempts. Many of the details of these events can be viewed in the Defend Data tab in the DeepRails console, but you can also see configuration details when polling this endpoint.
The status field indicates whether the workflow is active and currently accepting events. If the workflow status is inactive, no events submitted for the workflow will be processed.
The stats field contains counts of the events processed by the workflow, which can be used to determine the efficacy of the workflow. The events field lists the details of the most recent events processed by the workflow in a format similar to what is returned when you retrieve an event’s details.
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.
Query Parameters
limit
integer
default:10
Limit the number of returned events associated with this workflow. Defaults to 10.
Response
Workflow retrieved successfully
workflow_id
string
required
A unique workflow ID used to identify the workflow in other endpoints.
Example:
"defend_abc123"
name
string
required
A human-readable name for the workflow that will correspond to it's workflow ID.
Example:
"Test Workflow"
description
string
required
A description for the workflow, to help you remember what that workflow means to your organization.
Example:
"A workflow used to test the DeepRails API"
status
enum<string>
required
Status of the selected workflow. May be inactive or active. Inactive workflows will not accept events.
Available options:
inactive,
active
Example:
"active"
created_at
string<date-time>
required
The time the workflow was created in UTC.
updated_at
string<date-time>
required
The most recent time the workflow was updated in UTC.
threshold_type
enum<string>
required
Type of thresholds used to evaluate the event.
Available options:
custom,
automatic
Example:
"custom"
automatic_hallucination_tolerance_levels
object
required
Mapping of guardrail metric names to tolerance values. Values can be strings (low, medium, high) for automatic tolerance levels.
Show child attributes
Example:
null
custom_hallucination_threshold_values
object
required
Mapping of guardrail metric names to threshold values. Values can be floating point numbers (0.0-1.0) for custom thresholds.
Show child attributes
Example:
{ "correctness": 0.9 }
events
object[]
required
An array of events associated with this workflow.
Show child attributes
Example:
[ { "event_id": "evt_xxxxxxxxxxxx", "status": "completed", "improvement_tool_status": "improved", "improved_model_output": "Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.", "billing_request_id": "bill_0123456789abcdefabcd", "evaluations": [ { "attempt": "Initial Evaluation", "evaluation_status": "completed", "improvement_tool_status": "improvement_required", "analysis_of_failures": "The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.", "key_improvements": [ "Added a brief qualifier to the sentence to make it more accurate.", "Added a more detailed explanation of the differences between mitosis and meiosis." ], "guardrail_metrics": ["completeness", "instruction_adherence"], "run_mode": "precision", "model_input": { "system_prompt": "You are a helpful tutor specializing in AP science classes.", "user_prompt": "Explain the difference between mitosis and meiosis in one sentence.", "context": [ { "role": "user", "content": "I have an AP Bio exam tomorrow, can you help me study?" }, { "role": "tutor", "content": "Sure, I'll help you study." } ] }, "model_output": "Mitosis creates haploid gametes for reproduction, while meiosis produces identical diploid cells for growth.", "nametag": "Test", "progress": 100, "error_message": null, "evaluation_result": { "completeness": { "score": 0.6, "rationale": "The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.", "threshold": 0.8 }, "instruction_adherence": { "score": 0.25, "rationale": "The response does not highlight the key differences between mitosis and meiosis.", "threshold": 0.8 } }, "evaluation_total_cost": 0.01, "created_at": "2025-11-10T01:32:44.591Z" }, { "attempt": "Improvement Attempt 1", "evaluation_status": "completed", "improvement_tool_status": "improved", "analysis_of_failures": "null,", "key_improvements": "null,", "guardrail_metrics": ["completeness", "instruction_adherence"], "run_mode": "precision", "model_input": { "system_prompt": "You are a helpful tutor specializing in AP science classes.", "user_prompt": "Explain the difference between mitosis and meiosis in one sentence.", "context": [ { "role": "user", "content": "I have an AP Bio exam tomorrow, can you help me study?" }, { "role": "tutor", "content": "Sure, I'll help you study." } ] }, "model_output": "Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.", "nametag": "Test", "progress": 100, "error_message": null, "evaluation_result": { "completeness": { "score": 0.89, "rationale": "The sentence is concise, relevant, and well-structured, and it covers the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer. However, it overgeneralizes and makes unqualified universal claims: stating mitosis produces 'diploid' cells and meiosis produces 'four ... gametes' can be inaccurate in some biological contexts (e.g., mitosis in haploid cells or organisms, and oogenesis producing one functional ovum plus polar bodies). To make the sentence both accurate and still compact, add brief qualifiers—for example: 'In diploid organisms, mitosis produces two genetically similar diploid daughter cells for growth and repair, whereas meiosis involves two divisions that typically yield four genetically varied haploid cells (gametes), although in female animals often only one functional gamete results.' This preserves brevity while removing the main factual overgeneralizations.", "threshold": 0.8 }, "instruction_adherence": { "score": 1, "rationale": "The response exemplary meets the explicit instructions by delivering a single, well-formed sentence that clearly contrasts mitosis and meiosis using key distinguishing features (cell number, genetic identity/variation, ploidy, and biological purpose), showing concise and accurate adherence to the prompt.", "threshold": 0.8 } }, "evaluation_total_cost": 0.01, "created_at": "2025-11-10T01:32:44.591Z", "modified_at": "2025-11-10T01:32:44.591Z" } ] } ]
capabilities
object[]
required
Extended AI capabilities available to the event, if any. Can be web_search, file_search, and/or context_awareness.
The action used to improve outputs that fail one or more guardrail metrics for the workflow events.
Available options:
regen,
fixit,
do_nothing
Example:
"fixit"
stats
object
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"DeepRails","colors":{"primary":"#f2ca46","light":"#f2ca46","dark":"#c4990d"},"logo":{"light":"https://mintcdn.com/deeprails-479f3a7b/bbwR2lswB0faqCU8/logo/deeprails-gold.png?fit=max\u0026auto=format\u0026n=bbwR2lswB0faqCU8\u0026q=85\u0026s=f30c47f94d9c83f7345f61cf0bafdcb1","dark":"https://mintcdn.com/deeprails-479f3a7b/bbwR2lswB0faqCU8/logo/deeprails-gold.png?fit=max\u0026auto=format\u0026n=bbwR2lswB0faqCU8\u0026q=85\u0026s=f30c47f94d9c83f7345f61cf0bafdcb1"},"favicon":"https://mintcdn.com/deeprails-479f3a7b/bbwR2lswB0faqCU8/images/favicon-32x32.png?fit=max\u0026auto=format\u0026n=bbwR2lswB0faqCU8\u0026q=85\u0026s=2c44930664b6ca64cf1cff69a262631f","appearance":{"default":"dark","strict":true},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://www.deeprails.com/","label":"DeepRails Website"}],"primary":{"type":"button","label":"API Console Login","href":"https://console.deeprails.com/login"}},"footer":{"socials":{"linkedin":"https://linkedin.com/company/deeprails"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Python SDK","icon":"python","href":"https://pypi.org/project/deeprails"},{"anchor":"TypeScript SDK","icon":"square-js","href":"https://www.npmjs.com/package/deeprails/"},{"anchor":"Ruby SDK","icon":"gem","href":"https://rubygems.org/gems/deeprails"},{"anchor":"Go SDK","icon":"golang","href":"https://pkg.go.dev/github.com/deeprails/deeprails-go-sdk"},{"anchor":"Contact","icon":"envelope","href":"mailto:support@deeprails.ai"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"deeprails-479f3a7b","hasAudioNarration":false,"actualSubdomain":"deeprails-479f3a7b","customDomains":["docs.deeprails.com"],"gitSource":{"type":"github","owner":"deeprails","repo":"docs2","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10b7099ffae5051c40118f"},"entitlements":{},"buildId":"6ae395a7b0143684c1ccab8b","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Documentation","count":17},{"language":"default","tag":"API Reference","count":12},{"language":"default","tag":"API Documentation","count":12},{"language":"default","tag":"Guardrail Metrics","count":7},{"language":"default","tag":"Defend","count":6},{"language":"default","tag":"Monitor","count":5},{"language":"default","tag":"Defend API","count":3},{"language":"default","tag":"Evaluation Engine","count":3},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"Monitor API","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".sidebar>.section{margin-bottom:0px}.sidebar .page{margin-bottom:0px}.sidebar .page a{padding:0px 0px}:target,h2[id]:target,h3[id]:target,h4[id]:target,h5[id]:target,div[id]:target{position:relative;background:linear-gradient(to left, #f2ca46, #2b2a2a00);animation:highlight-section 3s ease-in-out;scroll-margin-top:80px;padding:0.2rem;border-radius:8px;border-left:4px solid #f2ca46}@keyframes highlight-section{0%{background:linear-gradient(to left, #f2ca46, #2b2a2a00)}50%{background:linear-gradient(to left, #f2ca46, #2b2a2a00)}100%{background:linear-gradient(to left, #f2ca46, #2b2a2a00)}}.tight-section>h3{margin-bottom:0.25rem}table,.markdown table,.prose table,.mdx table{table-layout:fixed!important;width:800px!important;max-width:100%!important;text-align:center!important}table th,.markdown table th,.prose table th,.mdx table th{text-align:center!important}table th:first-child,table td:first-child{width:200px!important}table th:nth-child(2),table td:nth-child(2){width:100px!important}table th:nth-child(3),table td:nth-child(3){width:500px!important}[data-page=\"auto-tables\"] table,.run-modes-table{table-layout:auto!important;width:auto!important;max-width:none!important;text-align:left!important}[data-page=\"auto-tables\"] table th,[data-page=\"auto-tables\"] table td,.run-modes-table th,.run-modes-table td{width:auto!important;text-align:left!important;white-space:nowrap;padding:0.5rem 0.75rem!important}.run-modes-table td:nth-child(3),.run-modes-table td:nth-child(4),.run-modes-table td:nth-child(5),.run-modes-table td:nth-child(6),.run-modes-table th:nth-child(3),.run-modes-table th:nth-child(4),.run-modes-table th:nth-child(5),.run-modes-table th:nth-child(6){text-align:center!important;letter-spacing:1px}.competitor-table{table-layout:fixed!important;width:100%!important;max-width:100%!important;text-align:center!important}.competitor-table th,.competitor-table td{text-align:center!important;vertical-align:top;white-space:normal}.competitor-table th:nth-child(1),.competitor-table td:nth-child(1){width:18%!important}.competitor-table th:nth-child(2),.competitor-table td:nth-child(2){width:18%!important}.competitor-table th:nth-child(3),.competitor-table td:nth-child(3){width:24%!important}.competitor-table th:nth-child(4),.competitor-table td:nth-child(4){width:40%!important}.docs-auto-table{table-layout:auto!important;width:100%!important;max-width:100%!important;text-align:left!important}.docs-auto-table th,.docs-auto-table td{width:auto!important;text-align:left!important;vertical-align:top;white-space:normal}[data-page=\"defend-details\"] h2{margin-top:1.5rem;margin-bottom:0.45rem;font-weight:750}[data-page=\"defend-details\"] h3{margin-top:1rem;margin-bottom:0.35rem;font-weight:700}[data-page=\"defend-details\"] p{margin-top:0.45rem;margin-bottom:0.45rem;line-height:1.55}[data-page=\"defend-details\"] ul,[data-page=\"defend-details\"] ol{margin-top:0.4rem;margin-bottom:0.75rem}[data-page=\"defend-details\"] li{margin-bottom:0.2rem}[data-page=\"defend-details\"] hr{margin:1rem 0}[data-page=\"defend-details\"] strong{font-weight:700}[data-page=\"defend-details\"] table{table-layout:auto!important;width:auto!important;max-width:100%!important;text-align:left!important}[data-page=\"defend-details\"] table th,[data-page=\"defend-details\"] table td{width:auto!important;text-align:left!important;vertical-align:top;white-space:normal;padding:0.5rem 0.75rem!important}"}]}
{"page":{"pagePath":"api-reference/defend/retrieve-a-workflows-details","slug":"/api-reference/defend/retrieve-a-workflows-details","pageMetadata":{"title":"Retrieve a Workflow's Details","description":"Use this endpoint to retrieve the details for a specific defend workflow\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /defend/{workflow_id}","href":"/api-reference/defend/retrieve-a-workflows-details","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use this endpoint to retrieve the details for a specific defend workflow\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,..._provideComponents(),...props.components};return _jsxs(_components.p,{children:[`Workflows will eventually contain many events, each with its own set of evaluations and improvement attempts. Many of the details of these events can be viewed in the Defend Data tab in the DeepRails console, but you can also see configuration details when polling this endpoint.`,_jsx(`br`,{}),_jsx(`br`,{}),`The `,_jsx(_components.code,{children:`status`}),` field indicates whether the workflow is active and currently accepting events. If the workflow status is `,_jsx(_components.code,{children:`inactive`}),`, no events submitted for the workflow will be processed.`,_jsx(`br`,{}),_jsx(`br`,{}),`The `,_jsx(_components.code,{children:`stats`}),` field contains counts of the events processed by the workflow, which can be used to determine the efficacy of the workflow. The `,_jsx(_components.code,{children:`events`}),` field lists the details of the most recent events processed by the workflow in a format similar to what is returned when you retrieve an event’s details.`]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Retrieve a Workflow's Details","description":"Use this endpoint to retrieve the details for a specific defend workflow\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /defend/{workflow_id}","href":"/api-reference/defend/retrieve-a-workflows-details","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Defend"],"summary":"Retrieve a Workflow's Details","description":"Use this endpoint to retrieve the details for a specific defend workflow\n","x-mint":{"content":"Workflows will eventually contain many events, each with its own set of evaluations and improvement attempts. Many of the details of these events can be viewed in the Defend Data tab in the DeepRails console, but you can also see configuration details when polling this endpoint.\u003cbr />\u003cbr />The `status` field indicates whether the workflow is active and currently accepting events. If the workflow status is `inactive`, no events submitted for the workflow will be processed.\u003cbr />\u003cbr />The `stats` field contains counts of the events processed by the workflow, which can be used to determine the efficacy of the workflow. The `events` field lists the details of the most recent events processed by the workflow in a format similar to what is returned when you retrieve an event's details."},"x-codeSamples":[{"lang":"python","label":"Retrieve a Workflow's Details","source":"from deeprails import DeepRails\n\nDEEPRAILS_API_KEY = \"YOUR_API_KEY\"\n\nclient = DeepRails(\n api_key=DEEPRAILS_API_KEY,\n)\n\nworkflow_response = client.defend.retrieve_workflow(\n workflow_id=\"wkfl_xxxxxxxxxxxx\"\n)\nprint(workflow_response)\n"}],"security":["4faf3602-e270-4a93-8851-aabee19525fc"],"parameters":["a91b3efd-baf2-4afd-b5b9-e529baf07b69","f6060ab6-e749-43ee-a85c-aa9cb9ae0e1c"],"responses":{"200":"0f3edefa-23fa-4874-ad3b-acb97b751a29","401":"50d8420a-109a-4aaf-8933-8d643e328ba6","404":"c87e9c7c-48bf-4703-90df-69072355dda7"},"method":"get","type":"path","servers":["354ef262-08b5-467e-b0b8-a640a41a5637"],"path":"/defend/{workflow_id}","baseUrlOptions":["https://api.deeprails.com"],"title":"Retrieve a Workflow's Details","codeSamples":[{"label":"Retrieve a Workflow's Details","lang":"python","source":"from deeprails import DeepRails\n\nDEEPRAILS_API_KEY = \"YOUR_API_KEY\"\n\nclient = DeepRails(\n api_key=DEEPRAILS_API_KEY,\n)\n\nworkflow_response = client.defend.retrieve_workflow(\n workflow_id=\"wkfl_xxxxxxxxxxxx\"\n)\nprint(workflow_response)\n"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"a91b3efd-baf2-4afd-b5b9-e529baf07b69":{"name":"workflow_id","in":"path","description":"The ID of the workflow to retrieve.","required":true,"schema":{"type":"string","isRequired":true,"description":"The ID of the workflow to retrieve.","uniqueKey":"","typeLabel":"string"}},"f6060ab6-e749-43ee-a85c-aa9cb9ae0e1c":{"name":"limit","in":"query","description":"Limit the number of returned events associated with this workflow. Defaults to 10.","required":false,"schema":{"type":"integer","default":10,"isRequired":false,"description":"Limit the number of returned events associated with this workflow. Defaults to 10.","uniqueKey":"","typeLabel":"integer"}}},"responses":{"0f3edefa-23fa-4874-ad3b-acb97b751a29":{"description":"Workflow retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"workflow_id":{"type":"string","description":"A unique workflow ID used to identify the workflow in other endpoints.","example":"defend_abc123","isRequired":true,"uniqueKey":"workflow_id","typeLabel":"string"},"name":{"type":"string","description":"A human-readable name for the workflow that will correspond to it's workflow ID.","example":"Test Workflow","nullable":false,"isRequired":true,"uniqueKey":"name","typeLabel":"string"},"description":{"type":"string","description":"A description for the workflow, to help you remember what that workflow means to your organization.","example":"A workflow used to test the DeepRails API","isRequired":true,"uniqueKey":"description","typeLabel":"string"},"status":{"type":"string","description":"Status of the selected workflow. May be `inactive` or `active`. Inactive workflows will not accept events.","example":"active","enum":["inactive","active"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"created_at":{"type":"string","format":"date-time","description":"The time the workflow was created in UTC.","isRequired":true,"uniqueKey":"created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","description":"The most recent time the workflow was updated in UTC.","isRequired":true,"uniqueKey":"updated_at","typeLabel":"string\u003cdate-time>"},"threshold_type":{"type":"string","enum":["custom","automatic"],"description":"Type of thresholds used to evaluate the event.","example":"custom","isRequired":true,"uniqueKey":"threshold_type","typeLabel":"enum\u003cstring>"},"automatic_hallucination_tolerance_levels":{"type":"object","description":"Mapping of guardrail metric names to tolerance values. Values can be strings (`low`, `medium`, `high`) for automatic tolerance levels.","example":null,"additionalProperties":{"type":"string","enum":["low","medium","high"],"uniqueKey":"automatic_hallucination_tolerance_levels.additionalProperties","typeLabel":"enum\u003cstring>"},"isRequired":true,"uniqueKey":"automatic_hallucination_tolerance_levels","typeLabel":"object"},"custom_hallucination_threshold_values":{"type":"object","description":"Mapping of guardrail metric names to threshold values. Values can be floating point numbers (0.0-1.0) for custom thresholds.","example":{"correctness":0.9},"additionalProperties":{"type":"number","format":"float","minimum":0,"maximum":1,"uniqueKey":"custom_hallucination_threshold_values.additionalProperties","typeLabel":"number\u003cfloat>"},"isRequired":true,"uniqueKey":"custom_hallucination_threshold_values","typeLabel":"object"},"events":{"type":"array","description":"An array of events associated with this workflow.","items":{"type":"object","properties":{"event_id":{"type":"string","description":"A unique workflow event ID.","example":"wkfl_evt_def456","uniqueKey":"events.items.[INDEX].event_id","typeLabel":"string"},"status":{"type":"string","description":"Status of the event.","example":"completed","enum":["completed","failed","in_progress"],"uniqueKey":"events.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"improvement_tool_status":{"type":"string","description":"Status of the improvement tool used to improve the event. `improvement_required` indicates that the evaluation is complete and the improvement action is needed but is not taking place. `improved` and `improvement_failed` indicate when the improvement action concludes, successfully and unsuccessfully, respectively. `no_improvement_required` means that the first evaluation passed all its metrics!","example":"improved","enum":["improved","improvement_failed","no_improvement_required","improvement_required"],"uniqueKey":"events.items.[INDEX].improvement_tool_status","typeLabel":"enum\u003cstring>"},"improved_model_output":{"type":"string","description":"Improved model output after improvement tool was applied.","example":"Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.","uniqueKey":"events.items.[INDEX].improved_model_output","typeLabel":"string"},"billing_request_id":{"type":"string","description":"The ID of the billing request for the event.","example":"bill_0123456789abcdefabcd","uniqueKey":"events.items.[INDEX].billing_request_id","typeLabel":"string"},"evaluations":{"type":"array","description":"An array of evaluations for this event.","items":{"type":"object","properties":{"attempt":{"type":"string","description":"The attempt number or identifier for this evaluation.","example":"Improvement Attempt 1","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].attempt","typeLabel":"string"},"evaluation_status":{"type":"string","description":"Status of the evaluation.","example":"completed","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].evaluation_status","typeLabel":"string"},"improvement_tool_status":{"type":"string","description":"Status of the improvement tool used to improve the event. `improvement_required` indicates that the evaluation is complete and the improvement action is needed but is not taking place. `improved` and `improvement_failed` indicate when the improvement action concludes, successfully and unsuccessfully, respectively. `no_improvement_required` means that the first evaluation passed all its metrics!","example":"improvement_required","enum":["improved","improvement_failed","no_improvement_required","improvement_required"],"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].improvement_tool_status","typeLabel":"enum\u003cstring>"},"analysis_of_failures":{"type":"string","description":"Analysis of the failures of the model_output according to the guardrail metrics evaluated.","example":"The model output does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].analysis_of_failures","typeLabel":"string"},"key_improvements":{"type":"array","description":"A list of key improvements made to the model_output to address the failures.","items":{"type":"string","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].key_improvements.items.[INDEX]","typeLabel":"string"},"example":["Added a brief qualifier to the sentence to make it more accurate.","Added a more detailed explanation of the differences between mitosis and meiosis."],"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].key_improvements","typeLabel":"string[]"},"guardrail_metrics":{"type":"array","description":"An array of guardrail metrics evaluated.","items":{"type":"string","example":"completeness, instruction_adherence","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].guardrail_metrics.items.[INDEX]","typeLabel":"string"},"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].guardrail_metrics","typeLabel":"string[]"},"run_mode":{"type":"string","description":"Run mode used for the evaluation.","example":"precision","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].run_mode","typeLabel":"string"},"model_input":{"type":"object","description":"The model input used for the evaluation.","additionalProperties":true,"example":{"user_prompt":"Explain the difference between mitosis and meiosis in one sentence."},"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].model_input","typeLabel":"object"},"model_output":{"type":"string","description":"The model output that was evaluated.","example":"Mitosis creates haploid gametes for reproduction, while meiosis produces identical diploid cells for growth.","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].model_output","typeLabel":"string"},"nametag":{"type":"string","description":"An optional tag for the evaluation.","example":"Test Event","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].nametag","typeLabel":"string"},"progress":{"type":"integer","description":"Evaluation progress (0-100).","example":100,"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].progress","typeLabel":"integer"},"error_message":{"type":"string","description":"Error message if the evaluation failed.","example":null,"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].error_message","typeLabel":"string"},"evaluation_result":{"type":"object","description":"The result of the evaluation.","additionalProperties":true,"example":{"completeness":{"score":0.89,"rationale":"The sentence is concise, relevant, and well-structured, and it covers the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer. However, it overgeneralizes and makes unqualified universal claims: stating mitosis produces 'diploid' cells and meiosis produces 'four ... gametes' can be inaccurate in some biological contexts (e.g., mitosis in haploid cells or organisms, and oogenesis producing one functional ovum plus polar bodies). To make the sentence both accurate and still compact, add brief qualifiers—for example: 'In diploid organisms, mitosis produces two genetically similar diploid daughter cells for growth and repair, whereas meiosis involves two divisions that typically yield four genetically varied haploid cells (gametes), although in female animals often only one functional gamete results.' This preserves brevity while removing the main factual overgeneralizations.","threshold":0.8},"instruction_adherence":{"score":1,"rationale":"","threshold":0.8}},"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].evaluation_result","typeLabel":"object"},"evaluation_total_cost":{"type":"number","format":"float","description":"Total cost of the evaluation.","example":0.01,"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].evaluation_total_cost","typeLabel":"number\u003cfloat>"},"created_at":{"type":"string","format":"date-time","description":"The time the evaluation was created in UTC.","example":"2025-11-10T01:32:44.591Z","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].created_at","typeLabel":"string\u003cdate-time>"},"modified_at":{"type":"string","format":"date-time","description":"The time the evaluation was last modified in UTC.","example":"2025-11-10T01:32:44.591Z","uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX].modified_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"events.items.[INDEX].evaluations.items.[INDEX]","typeLabel":"object"},"uniqueKey":"events.items.[INDEX].evaluations","typeLabel":"object[]"}},"uniqueKey":"events.items.[INDEX]","typeLabel":"object"},"example":[{"event_id":"evt_xxxxxxxxxxxx","status":"completed","improvement_tool_status":"improved","improved_model_output":"Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.","billing_request_id":"bill_0123456789abcdefabcd","evaluations":[{"attempt":"Initial Evaluation","evaluation_status":"completed","improvement_tool_status":"improvement_required","analysis_of_failures":"The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.","key_improvements":["Added a brief qualifier to the sentence to make it more accurate.","Added a more detailed explanation of the differences between mitosis and meiosis."],"guardrail_metrics":["completeness","instruction_adherence"],"run_mode":"precision","model_input":{"system_prompt":"You are a helpful tutor specializing in AP science classes.","user_prompt":"Explain the difference between mitosis and meiosis in one sentence.","context":[{"role":"user","content":"I have an AP Bio exam tomorrow, can you help me study?"},{"role":"tutor","content":"Sure, I'll help you study."}]},"model_output":"Mitosis creates haploid gametes for reproduction, while meiosis produces identical diploid cells for growth.","nametag":"Test","progress":100,"error_message":null,"evaluation_result":{"completeness":{"score":0.6,"rationale":"The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.","threshold":0.8},"instruction_adherence":{"score":0.25,"rationale":"The response does not highlight the key differences between mitosis and meiosis.","threshold":0.8}},"evaluation_total_cost":0.01,"created_at":"2025-11-10T01:32:44.591Z"},{"attempt":"Improvement Attempt 1","evaluation_status":"completed","improvement_tool_status":"improved","analysis_of_failures":"null,","key_improvements":"null,","guardrail_metrics":["completeness","instruction_adherence"],"run_mode":"precision","model_input":{"system_prompt":"You are a helpful tutor specializing in AP science classes.","user_prompt":"Explain the difference between mitosis and meiosis in one sentence.","context":[{"role":"user","content":"I have an AP Bio exam tomorrow, can you help me study?"},{"role":"tutor","content":"Sure, I'll help you study."}]},"model_output":"Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.","nametag":"Test","progress":100,"error_message":null,"evaluation_result":{"completeness":{"score":0.89,"rationale":"The sentence is concise, relevant, and well-structured, and it covers the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer. However, it overgeneralizes and makes unqualified universal claims: stating mitosis produces 'diploid' cells and meiosis produces 'four ... gametes' can be inaccurate in some biological contexts (e.g., mitosis in haploid cells or organisms, and oogenesis producing one functional ovum plus polar bodies). To make the sentence both accurate and still compact, add brief qualifiers—for example: 'In diploid organisms, mitosis produces two genetically similar diploid daughter cells for growth and repair, whereas meiosis involves two divisions that typically yield four genetically varied haploid cells (gametes), although in female animals often only one functional gamete results.' This preserves brevity while removing the main factual overgeneralizations.","threshold":0.8},"instruction_adherence":{"score":1,"rationale":"The response exemplary meets the explicit instructions by delivering a single, well-formed sentence that clearly contrasts mitosis and meiosis using key distinguishing features (cell number, genetic identity/variation, ploidy, and biological purpose), showing concise and accurate adherence to the prompt.","threshold":0.8}},"evaluation_total_cost":0.01,"created_at":"2025-11-10T01:32:44.591Z","modified_at":"2025-11-10T01:32:44.591Z"}]}],"isRequired":true,"uniqueKey":"events","typeLabel":"object[]"},"capabilities":{"type":"array","description":"Extended AI capabilities available to the event, if any. Can be `web_search`, `file_search`, and/or `context_awareness`.","items":{"type":"object","properties":{"capability":{"type":"string","example":"web_search","uniqueKey":"capabilities.items.[INDEX].capability","typeLabel":"string"}},"uniqueKey":"capabilities.items.[INDEX]","typeLabel":"object"},"example":[{"capability":"web_search"},{"capability":"file_search"},{"capability":"context_awareness"}],"isRequired":true,"uniqueKey":"capabilities","typeLabel":"object[]"},"files":{"type":"array","description":"List of files associated with the workflow. If this is not empty, models can search these files when performing evaluations or remediations","items":{"type":"object","properties":{"file_name":{"type":"string","uniqueKey":"files.items.[INDEX].file_name","typeLabel":"string"},"file_id":{"type":"string","uniqueKey":"files.items.[INDEX].file_id","typeLabel":"string"},"file_size":{"type":"integer","uniqueKey":"files.items.[INDEX].file_size","typeLabel":"integer"},"presigned_url":{"type":"string","uniqueKey":"files.items.[INDEX].presigned_url","typeLabel":"string"},"presigned_url_expires_at":{"type":"string","format":"date-time","uniqueKey":"files.items.[INDEX].presigned_url_expires_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"files.items.[INDEX]","typeLabel":"object"},"example":[{"file_name":"example.pdf","file_id":"file_xxxxxxxxxxxx","file_size":1024,"presigned_url":"https://deeprails.com/files/example.pdf","presigned_url_expires_at":"2025-11-10T01:32:44.591Z"}],"isRequired":true,"uniqueKey":"files","typeLabel":"object[]"},"improvement_action":{"type":"string","description":"The action used to improve outputs that fail one or more guardrail metrics for the workflow events.","example":"fixit","enum":["regen","fixit","do_nothing"],"uniqueKey":"improvement_action","typeLabel":"enum\u003cstring>"},"stats":{"type":"object","properties":{"outputs_processed":{"type":"integer","description":"Total number of AI outputs processed by the workflow.","example":1,"uniqueKey":"stats.outputs_processed","typeLabel":"integer"},"outputs_below_threshold":{"type":"integer","description":"Number of AI outputs that failed the guardrails.","example":0,"uniqueKey":"stats.outputs_below_threshold","typeLabel":"integer"},"outputs_improved":{"type":"integer","description":"Number of AI outputs that were improved.","example":0,"uniqueKey":"stats.outputs_improved","typeLabel":"integer"}},"uniqueKey":"stats","typeLabel":"object"}},"required":["workflow_id","name","description","status","created_at","updated_at","threshold_type","automatic_hallucination_tolerance_levels","custom_hallucination_threshold_values","capabilities","files","events"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"workflow_id":"defend_abc123","name":"Test Workflow","description":"A workflow used to test the DeepRails API","status":"active","created_at":"2023-11-07T05:31:56Z","updated_at":"2023-11-07T05:31:56Z","threshold_type":"custom","automatic_hallucination_tolerance_levels":null,"custom_hallucination_threshold_values":{"correctness":0.9},"events":[{"event_id":"evt_xxxxxxxxxxxx","status":"completed","improvement_tool_status":"improved","improved_model_output":"Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.","billing_request_id":"bill_0123456789abcdefabcd","evaluations":[{"attempt":"Initial Evaluation","evaluation_status":"completed","improvement_tool_status":"improvement_required","analysis_of_failures":"The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.","key_improvements":["Added a brief qualifier to the sentence to make it more accurate.","Added a more detailed explanation of the differences between mitosis and meiosis."],"guardrail_metrics":["completeness","instruction_adherence"],"run_mode":"precision","model_input":{"system_prompt":"You are a helpful tutor specializing in AP science classes.","user_prompt":"Explain the difference between mitosis and meiosis in one sentence.","context":[{"role":"user","content":"I have an AP Bio exam tomorrow, can you help me study?"},{"role":"tutor","content":"Sure, I'll help you study."}]},"model_output":"Mitosis creates haploid gametes for reproduction, while meiosis produces identical diploid cells for growth.","nametag":"Test","progress":100,"error_message":null,"evaluation_result":{"completeness":{"score":0.6,"rationale":"The response is concise, and well-structured, but it does not cover the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer.","threshold":0.8},"instruction_adherence":{"score":0.25,"rationale":"The response does not highlight the key differences between mitosis and meiosis.","threshold":0.8}},"evaluation_total_cost":0.01,"created_at":"2025-11-10T01:32:44.591Z"},{"attempt":"Improvement Attempt 1","evaluation_status":"completed","improvement_tool_status":"improved","analysis_of_failures":"null,","key_improvements":"null,","guardrail_metrics":["completeness","instruction_adherence"],"run_mode":"precision","model_input":{"system_prompt":"You are a helpful tutor specializing in AP science classes.","user_prompt":"Explain the difference between mitosis and meiosis in one sentence.","context":[{"role":"user","content":"I have an AP Bio exam tomorrow, can you help me study?"},{"role":"tutor","content":"Sure, I'll help you study."}]},"model_output":"Mitosis produces two genetically identical diploid cells for growth and tissue repair, whereas meiosis generates four genetically varied haploid gametes for sexual reproduction.","nametag":"Test","progress":100,"error_message":null,"evaluation_result":{"completeness":{"score":0.89,"rationale":"The sentence is concise, relevant, and well-structured, and it covers the main differences (cell number, genetic similarity, ploidy, and biological role) appropriate to a one-sentence answer. However, it overgeneralizes and makes unqualified universal claims: stating mitosis produces 'diploid' cells and meiosis produces 'four ... gametes' can be inaccurate in some biological contexts (e.g., mitosis in haploid cells or organisms, and oogenesis producing one functional ovum plus polar bodies). To make the sentence both accurate and still compact, add brief qualifiers—for example: 'In diploid organisms, mitosis produces two genetically similar diploid daughter cells for growth and repair, whereas meiosis involves two divisions that typically yield four genetically varied haploid cells (gametes), although in female animals often only one functional gamete results.' This preserves brevity while removing the main factual overgeneralizations.","threshold":0.8},"instruction_adherence":{"score":1,"rationale":"The response exemplary meets the explicit instructions by delivering a single, well-formed sentence that clearly contrasts mitosis and meiosis using key distinguishing features (cell number, genetic identity/variation, ploidy, and biological purpose), showing concise and accurate adherence to the prompt.","threshold":0.8}},"evaluation_total_cost":0.01,"created_at":"2025-11-10T01:32:44.591Z","modified_at":"2025-11-10T01:32:44.591Z"}]}],"capabilities":[{"capability":"web_search"},{"capability":"file_search"},{"capability":"context_awareness"}],"files":[{"file_name":"example.pdf","file_id":"file_xxxxxxxxxxxx","file_size":1024,"presigned_url":"https://deeprails.com/files/example.pdf","presigned_url_expires_at":"2025-11-10T01:32:44.591Z"}],"improvement_action":"fixit","stats":{"outputs_processed":1,"outputs_below_threshold":0,"outputs_improved":0}}}},"exampleType":"generated"}},"exampleType":"generated"},"50d8420a-109a-4aaf-8933-8d643e328ba6":{"description":"Unauthorized","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"c87e9c7c-48bf-4703-90df-69072355dda7":{"description":"Workflow not found","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"4faf3602-e270-4a93-8851-aabee19525fc":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"354ef262-08b5-467e-b0b8-a640a41a5637":{"url":"https://api.deeprails.com","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/openapi.yaml"},"subdomain":"deeprails-479f3a7b","siteName":"DeepRails","title":"Retrieve a Workflow's Details - DeepRails","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-09T20:45:59.240Z","originalFileLocation":"api-reference/defend/retrieve-a-workflows-details.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use this endpoint to retrieve the details for a specific defend workflow\">\u003cmeta data-mint-head name=\"application-name\" content=\"DeepRails\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Retrieve a Workflow\u0026#x27;s Details - DeepRails\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use this endpoint to retrieve the details for a specific defend workflow\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DeepRails\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://deeprails-479f3a7b.mintlify.site/_mintlify/api/og/v2?division=Defend\u0026amp;title=Retrieve+a+Workflow%27s+Details\u0026amp;description=Use+this+endpoint+to+retrieve+the+details+for+a+specific+defend+workflow%0A\u0026amp;theme=e5255410c10d93655e7ca4a4\u0026amp;signature=1f028ce92183fff020e28c39e4287cc6b0a9187ec7d0b6ed9ab1bc46b46eeb07\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Retrieve a Workflow\u0026#x27;s Details - DeepRails\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use this endpoint to retrieve the details for a specific defend workflow\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://deeprails-479f3a7b.mintlify.site/_mintlify/api/og/v2?division=Defend\u0026amp;title=Retrieve+a+Workflow%27s+Details\u0026amp;description=Use+this+endpoint+to+retrieve+the+details+for+a+specific+defend+workflow%0A\u0026amp;theme=e5255410c10d93655e7ca4a4\u0026amp;signature=1f028ce92183fff020e28c39e4287cc6b0a9187ec7d0b6ed9ab1bc46b46eeb07\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/deeprails-479f3a7b/Z_VM1vKqq_sDqO8r/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DeepRails\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#f2ca46\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/defend/retrieve-a-workflows-details.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.deeprails.com/#organization\",\"name\":\"DeepRails\",\"url\":\"https://docs.deeprails.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/deeprails-479f3a7b/bbwR2lswB0faqCU8/logo/deeprails-gold.png?fit=max\u0026auto=format\u0026n=bbwR2lswB0faqCU8\u0026q=85\u0026s=f30c47f94d9c83f7345f61cf0bafdcb1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.deeprails.com#website\",\"name\":\"DeepRails\",\"url\":\"https://docs.deeprails.com\",\"publisher\":{\"@id\":\"https://docs.deeprails.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details#webpage\",\"url\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details\",\"name\":\"Retrieve a Workflow's Details\",\"description\":\"Use this endpoint to retrieve the details for a specific defend workflow\",\"dateModified\":\"2026-03-09T20:45:59.240Z\",\"isPartOf\":{\"@id\":\"https://docs.deeprails.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Documentation\",\"item\":\"https://docs.deeprails.com/api-reference/defend/create-a-workflow\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Defend\",\"item\":\"https://docs.deeprails.com/api-reference/defend/create-a-workflow\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Retrieve a Workflow's Details\",\"item\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details#apireference\",\"headline\":\"Retrieve a Workflow's Details\",\"name\":\"Retrieve a Workflow's Details\",\"description\":\"Use this endpoint to retrieve the details for a specific defend workflow\",\"url\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details\",\"mainEntityOfPage\":{\"@id\":\"https://docs.deeprails.com/api-reference/defend/retrieve-a-workflows-details#webpage\"},\"dateModified\":\"2026-03-09T20:45:59.240Z\",\"publisher\":{\"@id\":\"https://docs.deeprails.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.deeprails.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DeepRails\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"DeepRails\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/defend/retrieve-a-workflows-details.md","siteName":"DeepRails","nav":{"global":{"anchors":[{"anchor":"Python SDK","icon":"python","href":"https://pypi.org/project/deeprails"},{"anchor":"TypeScript SDK","icon":"square-js","href":"https://www.npmjs.com/package/deeprails/"},{"anchor":"Ruby SDK","icon":"gem","href":"https://rubygems.org/gems/deeprails"},{"anchor":"Go SDK","icon":"golang","href":"https://pkg.go.dev/github.com/deeprails/deeprails-go-sdk"},{"anchor":"Contact","icon":"envelope","href":"mailto:support@deeprails.ai"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"group":"Defend","pages":[{"title":"Create a Workflow","description":"Use this endpoint to create a new guardrail workflow by specifying guardrail thresholds, an improvement action, and optional extended capabilities.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /defend","href":"/api-reference/defend/create-a-workflow"},{"title":"Retrieve a Workflow's Details","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /defend/{workflow_id}","href":"/api-reference/defend/retrieve-a-workflows-details"},{"title":"Update a Workflow","description":"Use this endpoint to update an existing defend workflow if its details change.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml put /defend/{workflow_id}","href":"/api-reference/defend/update-a-workflow"},{"title":"Submit a Workflow Event","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /defend/{workflow_id}/events","href":"/api-reference/defend/submit-a-workflow-event"},{"title":"Retrieve an Event's Details","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /defend/{workflow_id}/events/{event_id}","href":"/api-reference/defend/retrieve-an-events-details"},{"title":"Stream a Workflow Event (Optimized)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /defend/{workflow_id}/events?stream=true","href":"/api-reference/defend/stream-a-workflow-event-optimized"}]},{"group":"Monitor","pages":[{"title":"Create a Monitor","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /monitor","href":"/api-reference/monitor/create-a-monitor"},{"title":"Retrieve a Monitor's Details","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /monitor/{monitor_id}","href":"/api-reference/monitor/retrieve-a-monitors-details"},{"title":"Update a Monitor","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml put /monitor/{monitor_id}","href":"/api-reference/monitor/update-a-monitor"},{"title":"Submit a Monitor Event","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /monitor/{monitor_id}/events","href":"/api-reference/monitor/submit-a-monitor-event"},{"title":"Retrieve a Monitor Event's Details","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /monitor/{monitor_id}/events/{event_id}","href":"/api-reference/monitor/retrieve-a-monitor-events-details"}]},{"group":"Files","pages":[{"title":"Upload a File","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /files/upload","href":"/api-reference/files/upload-a-file"}]}]}]}]},"basePath":"","title":"Retrieve a Workflow's Details - DeepRails","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CaRkHcld.js","snippetPresets-CbOVSLWB.js","utils-cjri0g4r.js","style-to-object-BY3JEAdk.js","utils-DINdUa17.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-B6z-PJGf.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BldndzCM.js","_Uint8Array-BFUkDgJK.js","isObject-FP1Yky1u.js","ApiExamples-gah5G0c1.js","usePlaygroundInputsStore-DMbftGRK.js","shallow-BPuQ-dV8.js","isEqual-Du6c450V.js","CodeSnippets-BSVM0Ibi.js","CodeSnippet-BtGQRZnK.js","use-playground-group-access-98JyaSW7.js","Page-DuvGhd6e.js","api-description-markdown-ja0XM5Ae.js","DynamicMarkdown-DgKZ4_wp.js","SectionHeading-S4Jc_qPe.js","MethodPill-HIsDH_bI.js","getPastedJson-BKEmMYEO.js","Check2Icon-CRFAnWm9.js","axios-CsQoIw0U.js","Markdown-CexXCNoj.js","AssistantPageLink-C2AZnMAs.js","dist-CjxLTLs9.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}