Back to prompt library
Define Metaflow Diagnostic Flow
Linked challenge: Software-Defined Control Switch Diagnostic Agent with Claude Agents SDK and Metaflow
Prompt source
implementation16 lines5 sectionsNo variables0 checklist items
from metaflow import FlowSpec, step
from anthropic import Anthropic
class SwitchDiagnosticFlow(FlowSpec):
@step
def start(self):
# Ingest telemetry and call Claude agent
self.next(self.diagnose)
@step
def diagnose(self):
# Use Claude extended thinking to trace network fault
self.next(self.end)
@step
def end(self):
print('Diagnosis complete')
if __name__ == '__main__':
SwitchDiagnosticFlow()