This commit is contained in:
alma 2025-05-22 18:46:19 +02:00
parent a7428913d0
commit 8476e1d838

View File

@ -18,7 +18,16 @@ export class N8nService {
async triggerMissionCreation(data: any): Promise<any> {
try {
console.log('Triggering n8n workflow with data:', JSON.stringify(data, null, 2));
// Add API key to the data
const dataWithApiKey = {
...data,
config: {
...data.config,
N8N_API_KEY: this.apiKey
}
};
console.log('Triggering n8n workflow with data:', JSON.stringify(dataWithApiKey, null, 2));
console.log('Using webhook URL:', this.webhookUrl);
console.log('API key present:', !!this.apiKey);
@ -30,7 +39,7 @@ export class N8nService {
'Content-Type': 'application/json',
'x-api-key': this.apiKey
},
body: data
body: dataWithApiKey
};
console.log('Full request details:', JSON.stringify(requestDetails, null, 2));
@ -40,7 +49,7 @@ export class N8nService {
'Content-Type': 'application/json',
'x-api-key': this.apiKey
},
body: JSON.stringify(data),
body: JSON.stringify(dataWithApiKey),
});
console.log('Webhook response status:', response.status);