W n8n
This commit is contained in:
parent
a7428913d0
commit
8476e1d838
@ -18,7 +18,16 @@ export class N8nService {
|
|||||||
|
|
||||||
async triggerMissionCreation(data: any): Promise<any> {
|
async triggerMissionCreation(data: any): Promise<any> {
|
||||||
try {
|
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('Using webhook URL:', this.webhookUrl);
|
||||||
console.log('API key present:', !!this.apiKey);
|
console.log('API key present:', !!this.apiKey);
|
||||||
|
|
||||||
@ -30,7 +39,7 @@ export class N8nService {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'x-api-key': this.apiKey
|
'x-api-key': this.apiKey
|
||||||
},
|
},
|
||||||
body: data
|
body: dataWithApiKey
|
||||||
};
|
};
|
||||||
console.log('Full request details:', JSON.stringify(requestDetails, null, 2));
|
console.log('Full request details:', JSON.stringify(requestDetails, null, 2));
|
||||||
|
|
||||||
@ -40,7 +49,7 @@ export class N8nService {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'x-api-key': this.apiKey
|
'x-api-key': this.apiKey
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(dataWithApiKey),
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Webhook response status:', response.status);
|
console.log('Webhook response status:', response.status);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user