import html import os import re # Single source of truth for diagram styling. This is prepended to every # Mermaid fence, so diagrams must NOT carry their own `---config---` # front matter: Mermaid only accepts front matter as the very first thing in # the diagram, and this directive already occupies that position. # # `look: handDrawn` needs Mermaid >= 11 (bundled by mkdocs-material >= 9.6). # `clusterBkg`/`clusterBorder` override Mermaid's hardcoded #ffffde subgraph # yellow, which no other theme variable reaches. # fontFamily is deliberately the system stack, NOT a webfont: Mermaid measures # label widths at render time, and a webfont that finishes loading afterwards # swaps in with different metrics and clips the last characters of labels. # Must match --md-mermaid-font-family in custom.css. MERMAID_WORKFLOW_INIT = """%%{init: {'look': 'handDrawn', 'theme': 'base', 'themeVariables': {'primaryColor': '#eef2ff', 'primaryBorderColor': '#1e40af', 'primaryTextColor': '#1e293b', 'lineColor': '#1e3a8a', 'edgeLabelBackground': '#ffffff', 'clusterBkg': '#fbfcff', 'clusterBorder': '#2563eb', 'fontFamily': '-apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif', 'fontSize': '15px'}, 'flowchart': {'nodeSpacing': 50, 'rankSpacing': 58, 'padding': 14, 'htmlLabels': true, 'curve': 'basis'}}}%% """ def mermaid_fence(source, language, class_name, options, md, **kwargs): """Render Mermaid diagrams in a compact, consistently framed workflow card.""" from pymdownx.superfences import fence_code_format rendered = fence_code_format( MERMAID_WORKFLOW_INIT + source, language, class_name, options, md, **kwargs, ) return rendered.replace( '
',
'',
1,
).replace("", "", 1)
VISUAL_JOURNEY_PAGES = {
"quickstart/index.md",
"devguide/ai/a2a-integration.md",
"devguide/ai/agent-framework-recipes.md",
"devguide/ai/conductor-agents.md",
"devguide/ai/first-ai-agent.md",
"devguide/ai/human-in-the-loop.md",
"devguide/ai/mcp-guide.md",
}
SDK_PAGE_CONFIG = {
"java": {
"name": "Java",
"examples": "https://github.com/conductor-oss/java-sdk/tree/main/examples",
"agentic_examples": "https://github.com/conductor-oss/java-sdk/tree/main/agent-examples",
"api_examples": None,
"agent": True,
},
"python": {
"name": "Python",
"examples": "https://github.com/conductor-oss/python-sdk/tree/main/examples",
"agentic_examples": "https://github.com/conductor-oss/python-sdk/tree/main/examples/agentic_workflows",
"api_examples": None,
"agent": True,
},
"go": {
"name": "Go",
"examples": "https://github.com/conductor-oss/go-sdk/tree/main/examples",
"agentic_examples": None,
"api_examples": None,
"agent": False,
},
"javascript": {
"name": "JavaScript / TypeScript",
"examples": "https://github.com/conductor-oss/javascript-sdk/tree/main/examples",
"agentic_examples": "https://github.com/conductor-oss/javascript-sdk/tree/main/examples/agentic-workflows",
"api_examples": "https://github.com/conductor-oss/javascript-sdk/tree/main/examples/api-journeys",
"agent": True,
},
"csharp": {
"name": "C# / .NET",
"examples": "https://github.com/conductor-oss/csharp-sdk/tree/main/csharp-examples",
"agentic_examples": None,
"api_examples": None,
"agent": True,
},
"ruby": {
"name": "Ruby",
"examples": "https://github.com/conductor-oss/ruby-sdk/tree/main/examples",
"agentic_examples": "https://github.com/conductor-oss/ruby-sdk/tree/main/examples/agentic_workflows",
"api_examples": None,
"agent": False,
},
"rust": {
"name": "Rust",
"examples": "https://github.com/conductor-oss/rust-sdk/tree/main/examples",
"agentic_examples": "https://github.com/conductor-oss/rust-sdk/tree/main/examples",
"api_examples": None,
"agent": False,
},
}
def sdk_intro(language):
"""Return the shared navigation and connection content for an SDK page."""
config = SDK_PAGE_CONFIG[language]
agent_link = "[Run your first agent](../../quickstart/first-agent.md)" if config["agent"] else "Coming soon"
def example_link(url, label):
return f"[{label}]({url})" if url else "Not currently maintained upstream"
csharp_note = "\n\nC# reads `CONDUCTOR_SERVER_URL` when you set `Configuration.BasePath`; pass `OrkesAuthenticationSettings` explicitly for key/secret authentication."
connection_note = csharp_note if language == "csharp" else "\n\nThis SDK reads these environment variables when constructing its standard client configuration."
return f'''## Start here
| Goal | Guide |
|---|---|
| Run a workflow | [Run your first workflow](../../quickstart/first-workflow.md) |
| Write a worker | [Write your first worker](../../quickstart/first-worker.md) |
| Build an agent | {agent_link} |
## Featured examples
| Category | Maintained upstream example |
|---|---|
| Workflow and worker | [Examples]({config["examples"]}) |
| Agentic workflow | {example_link(config["agentic_examples"], "Agentic workflow examples")} |
| API journey | {example_link(config["api_examples"], "API journey examples")} |
The agentic-workflow row covers SDK examples that orchestrate LLMs or tools. It is separate from the SDK-authored Conductor Agent quickstart, which is {"available above" if config["agent"] else "coming soon for this SDK"}.
!!! info "Connect to Conductor"
For local OSS, set `CONDUCTOR_SERVER_URL=http://localhost:8080/api`.
For Orkes Developer Edition, set `CONDUCTOR_SERVER_URL=https://developer.orkescloud.com/api`, `CONDUCTOR_AUTH_KEY`, and `CONDUCTOR_AUTH_SECRET`. Keep credentials out of source control.{connection_note}
'''
def on_pre_page_macros(env):
"""Place each compact page description directly after its H1.
Dedicated tutorial journeys already provide a richer visual introduction.
For the remaining public pages, reuse front-matter descriptions and remove
an identical first paragraph so the summary is additive only when needed.
"""
page = env.page
redirect_target = (page.meta or {}).get("redirect_to")
if redirect_target:
site_url = env.variables["config"]["site_url"].rstrip("/")
page.canonical_url = f"{site_url}/{redirect_target.lstrip('/')}"
meta = page.meta or {}
description = meta.get("description")
has_visual_hero = re.search(
r'