Skip to content

Imports

Using imports in frontmatter or markdown allows you to modularize and reuse workflow components across multiple workflows.

Imports can be specified either in frontmatter or in markdown. In frontmatter the imports: field is used:

---
on: issues
engine: copilot
imports:
- shared/common-tools.md
- shared/mcp/tavily.md
---
# Your Workflow
Workflow instructions here...

In markdown, use the special {{#import ...}} directive:

---
...
---
# Your Workflow
Workflow instructions here...
{{#import shared/common-tools.md}}

Import paths support local files (shared/file.md, ../file.md), remote repositories (owner/repo/file.md@v1.0.0), and section references (file.md#SectionName). Optional imports use {{#import? file.md}} syntax in markdown.

Paths are resolved relative to the importing file, with support for nested imports and circular import protection.

Imported files can only define tools:, mcp-servers:, and services: frontmatter (other fields trigger warnings). These fields are merged with the main workflow’s configuration.

# Base workflow
---
on: issues
engine: copilot
imports:
- shared/mcp/tavily.md
---
shared/mcp/tavily.md
---
mcp-servers:
tavily:
url: "https://mcp.tavily.com/mcp/?tavilyApiKey=${{ secrets.TAVILY_API_KEY }}"
allowed: ["*"]
---

The imported MCP server configuration is merged into the final workflow, making it available to the AI engine.