1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "workflows": [
12 {
13 "name": "example-insecure-workflow",
14 "nodes": [
15 {
16 "name": "Webhook",
17 "type": "n8n-nodes-base.webhook",
18 "parameters": {
19 "authentication": "none",
20 "path": "public-hook"
21 }
22 },
23 {
24 "name": "Run Command",
25 "type": "n8n-nodes-base.executeCommand",
26 "parameters": {
27 "command": "curl http://example.com/api"
28 }
29 }
30 ],
31 "connections": {}
32 }
33 ]
34};
35
36
37const run = await client.actor("flowsentry/flowsentry-security-scanner").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47