import { loadAndEncodeWorkflow } from 'codika';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import crypto from 'crypto';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Required: array of workflow file paths (relative to config.ts)
export const WORKFLOW_FILES = [
'workflows/main-workflow.json',
'workflows/helper-workflow.json',
];
// Required: returns the full deployment configuration
export function getConfiguration(): ProcessDeploymentConfigurationInput {
return {
title: 'My Automation',
subtitle: 'One-line description of what it does',
description: 'Longer description of capabilities and benefits.',
workflows: [
{
workflowTemplateId: 'main-workflow',
workflowId: 'main-workflow',
workflowName: 'Main Workflow',
integrationUids: ['anthropic', 'google_gmail'],
triggers: [/* trigger definitions */],
outputSchema: [/* output field definitions */],
n8nWorkflowJsonBase64: loadAndEncodeWorkflow(
__dirname, 'workflows/main-workflow.json'
),
cost: 10,
},
],
tags: ['email', 'ai'],
};
}