- docker-compose: n8n container (port 5678) with PostgreSQL backend - n8n/: 7 TypeScript workflow files + import script + README - Workflows: 4 CMS BI data ingestion + 3 email reports - README: updated with n8n env vars and port - .dockerignore: exclude import.sh from container
15 lines
759 B
TypeScript
15 lines
759 B
TypeScript
import { workflow, node, trigger, expr } from '@n8n/workflow-sdk';
|
|
|
|
const cron = trigger({ type: 'n8n-nodes-base.scheduleTrigger', version: 1.3,
|
|
config: { name: 'Daily 05:00 UTC', parameters: { rule: { interval: [{ field: 'cronExpression', expression: '0 5 * * *' }] } } } });
|
|
|
|
const sendReport = node({ type: 'n8n-nodes-base.httpRequest', version: 4.4,
|
|
config: { name: 'Send Daily Report', parameters: {
|
|
method: 'POST', url: 'http://100.91.25.139:8765/api/send-report/daily',
|
|
sendBody: false, sendHeaders: false,
|
|
options: { timeout: 60000, redirect: { redirect: {} }, response: { response: { responseFormat: 'json' } } }
|
|
} } });
|
|
|
|
export default workflow('CMS_BI_EMAIL_DAILY', '📧 CMS BI: Daily Email Report')
|
|
.add(cron).to(sendReport);
|