typings.d.ts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. declare namespace API {
  2. type activeVersion =
  3. {
  4. /** Unique identifier for this workflow version */
  5. 'versionId'?: string;
  6. /** The workflow this version belongs to */
  7. 'workflowId'?: string;
  8. 'nodes'?: node[];
  9. 'connections'?: Record<string, any>;
  10. /** Comma-separated list of author IDs who contributed to this version */
  11. 'authors'?: string;
  12. 'createdAt'?: string;
  13. 'updatedAt'?: string;
  14. }
  15. type audit =
  16. {
  17. 'Credentials Risk Report'?: Record<string, any>;
  18. 'Database Risk Report'?: Record<string, any>;
  19. 'Filesystem Risk Report'?: Record<string, any>;
  20. 'Nodes Risk Report'?: Record<string, any>;
  21. 'Instance Risk Report'?: Record<string, any>;
  22. }
  23. type Audit = [object Object];
  24. type create =
  25. {
  26. 'id'?: string;
  27. 'key': string;
  28. 'value': string;
  29. 'type'?: string;
  30. 'projectId'?: string;
  31. }
  32. type createCredentialResponse =
  33. {
  34. 'id': string;
  35. 'name': string;
  36. 'type': string;
  37. 'createdAt': string;
  38. 'updatedAt': string;
  39. }
  40. type credential =
  41. {
  42. 'id'?: string;
  43. 'name': string;
  44. 'type': string;
  45. 'data': Record<string, any>;
  46. /** Whether this credential has resolvable fields */
  47. 'isResolvable'?: boolean;
  48. 'createdAt'?: string;
  49. 'updatedAt'?: string;
  50. }
  51. type Credential = [object Object];
  52. type credentialType =
  53. {
  54. 'displayName'?: string;
  55. 'name'?: string;
  56. 'type'?: string;
  57. 'default'?: string;
  58. }
  59. type CredentialType = [object Object];
  60. type deleteCredentialParams =
  61. {
  62. /** The credential ID that needs to be deleted */
  63. 'id': string;
  64. }
  65. type deleteExecutionsIdParams =
  66. {
  67. ''?: any;
  68. }
  69. type deleteProjectsProjectIdParams =
  70. {
  71. /** The ID of the project. */
  72. 'projectId': string;
  73. }
  74. type deleteProjectsProjectIdUsersUserIdParams =
  75. {
  76. /** The ID of the project. */
  77. 'projectId': string;
  78. /** The ID of the user. */
  79. 'userId': string;
  80. }
  81. type deleteTagsIdParams =
  82. {
  83. ''?: any;
  84. }
  85. type deleteUsersIdParams =
  86. {
  87. ''?: any;
  88. }
  89. type deleteVariablesIdParams =
  90. {
  91. ''?: any;
  92. }
  93. type deleteWorkflowsIdParams =
  94. {
  95. ''?: any;
  96. }
  97. type error =
  98. {
  99. 'code'?: string;
  100. 'message': string;
  101. 'description'?: string;
  102. }
  103. type Error = [object Object];
  104. type execution =
  105. {
  106. 'id'?: number;
  107. 'data'?: Record<string, any>;
  108. 'finished'?: boolean;
  109. 'mode'?: "cli" | "error" | "integrated" | "internal" | "manual" | "retry" | "trigger" | "webhook" | "evaluation" | "chat";
  110. 'retryOf'?: number;
  111. 'retrySuccessId'?: number;
  112. 'startedAt'?: string;
  113. /** The time at which the execution stopped. Will only be null for executions that still have the status 'running'. */
  114. 'stoppedAt'?: string;
  115. 'workflowId'?: number;
  116. 'waitTill'?: string;
  117. 'customData'?: Record<string, any>;
  118. 'status'?: "canceled" | "crashed" | "error" | "new" | "running" | "success" | "unknown" | "waiting";
  119. }
  120. type Execution = [object Object];
  121. type executionList =
  122. {
  123. 'data'?: execution[];
  124. /** Paginate through executions by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. */
  125. 'nextCursor'?: string;
  126. }
  127. type ExecutionList = [object Object];
  128. type getCredentialsSchemaCredentialTypeNameParams =
  129. {
  130. /** The credential type name that you want to get the schema for */
  131. 'credentialTypeName': string;
  132. }
  133. type getExecutionsIdParams =
  134. {
  135. ''?: any;
  136. ''?: any;
  137. }
  138. type getExecutionsParams =
  139. {
  140. ''?: any;
  141. /** Status to filter the executions by. */
  142. 'status'?: "canceled" | "error" | "running" | "success" | "waiting";
  143. /** Workflow to filter the executions by. */
  144. 'workflowId'?: string;
  145. 'projectId'?: string;
  146. ''?: any;
  147. ''?: any;
  148. }
  149. type getProjectsParams =
  150. {
  151. ''?: any;
  152. ''?: any;
  153. }
  154. type getTagsIdParams =
  155. {
  156. ''?: any;
  157. }
  158. type getTagsParams =
  159. {
  160. ''?: any;
  161. ''?: any;
  162. }
  163. type getUsersIdParams =
  164. {
  165. ''?: any;
  166. ''?: any;
  167. }
  168. type getUsersParams =
  169. {
  170. ''?: any;
  171. ''?: any;
  172. ''?: any;
  173. 'projectId'?: string;
  174. }
  175. type getVariablesParams =
  176. {
  177. ''?: any;
  178. ''?: any;
  179. 'projectId'?: string;
  180. 'state'?: "empty";
  181. }
  182. type getWorkflowsIdParams =
  183. {
  184. /** Set this to avoid retrieving pinned data */
  185. 'excludePinnedData'?: boolean;
  186. ''?: any;
  187. }
  188. type getWorkflowsIdTagsParams =
  189. {
  190. ''?: any;
  191. }
  192. type getWorkflowsIdVersionIdParams =
  193. {
  194. ''?: any;
  195. /** The version ID to retrieve */
  196. 'versionId': string;
  197. }
  198. type getWorkflowsParams =
  199. {
  200. 'active'?: boolean;
  201. 'tags'?: string;
  202. 'name'?: string;
  203. 'projectId'?: string;
  204. /** Set this to avoid retrieving pinned data */
  205. 'excludePinnedData'?: boolean;
  206. ''?: any;
  207. ''?: any;
  208. }
  209. type importResult =
  210. {
  211. 'variables'?: { 'added'?: string[]; 'changed'?: string[]; };
  212. 'credentials'?: { 'id'?: string; 'name'?: string; 'type'?: string; }[];
  213. 'workflows'?: { 'id'?: string; 'name'?: string; }[];
  214. 'tags'?: { 'tags'?: { 'id'?: string; 'name'?: string; }[]; 'mappings'?: { 'workflowId'?: string; 'tagId'?: string; }[]; };
  215. }
  216. type ImportResult = [object Object];
  217. type node =
  218. {
  219. 'id'?: string;
  220. 'name'?: string;
  221. 'webhookId'?: string;
  222. 'disabled'?: boolean;
  223. 'notesInFlow'?: boolean;
  224. 'notes'?: string;
  225. 'type'?: string;
  226. 'typeVersion'?: number;
  227. 'executeOnce'?: boolean;
  228. 'alwaysOutputData'?: boolean;
  229. 'retryOnFail'?: boolean;
  230. 'maxTries'?: number;
  231. 'waitBetweenTries'?: number;
  232. /** use onError instead */
  233. 'continueOnFail'?: boolean;
  234. 'onError'?: string;
  235. 'position'?: number[];
  236. 'parameters'?: Record<string, any>;
  237. 'credentials'?: Record<string, any>;
  238. 'createdAt'?: string;
  239. 'updatedAt'?: string;
  240. }
  241. type Node = [object Object];
  242. type patchProjectsProjectIdUsersUserIdParams =
  243. {
  244. /** The ID of the project. */
  245. 'projectId': string;
  246. /** The ID of the user. */
  247. 'userId': string;
  248. }
  249. type patchUsersIdRoleParams =
  250. {
  251. ''?: any;
  252. }
  253. type postExecutionsIdRetryParams =
  254. {
  255. ''?: any;
  256. }
  257. type postProjectsProjectIdUsersParams =
  258. {
  259. /** The ID of the project. */
  260. 'projectId': string;
  261. }
  262. type postWorkflowsIdActivateParams =
  263. {
  264. ''?: any;
  265. }
  266. type postWorkflowsIdDeactivateParams =
  267. {
  268. ''?: any;
  269. }
  270. type project =
  271. {
  272. 'id'?: string;
  273. 'name': string;
  274. 'type'?: string;
  275. }
  276. type projectList =
  277. {
  278. 'data'?: project[];
  279. /** Paginate through projects by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. */
  280. 'nextCursor'?: string;
  281. }
  282. type pull =
  283. {
  284. 'force'?: boolean;
  285. 'variables'?: Record<string, any>;
  286. }
  287. type Pull = [object Object];
  288. type putCredentialsIdTransferParams =
  289. {
  290. ''?: any;
  291. }
  292. type putProjectsProjectIdParams =
  293. {
  294. /** The ID of the project. */
  295. 'projectId': string;
  296. }
  297. type putTagsIdParams =
  298. {
  299. ''?: any;
  300. }
  301. type putVariablesIdParams =
  302. {
  303. ''?: any;
  304. }
  305. type putWorkflowsIdParams =
  306. {
  307. ''?: any;
  308. }
  309. type putWorkflowsIdTagsParams =
  310. {
  311. ''?: any;
  312. }
  313. type putWorkflowsIdTransferParams =
  314. {
  315. ''?: any;
  316. }
  317. type role =
  318. {
  319. 'id'?: number;
  320. 'name'?: string;
  321. 'scope'?: string;
  322. /** Time the role was created. */
  323. 'createdAt'?: string;
  324. /** Last time the role was updated. */
  325. 'updatedAt'?: string;
  326. }
  327. type Role = [object Object];
  328. type sharedWorkflow =
  329. {
  330. 'role'?: string;
  331. 'workflowId'?: string;
  332. 'projectId'?: string;
  333. 'project'?: { 'id'?: string; 'name'?: string; 'type'?: string; };
  334. 'createdAt'?: string;
  335. 'updatedAt'?: string;
  336. }
  337. type tag =
  338. {
  339. 'id'?: string;
  340. 'name': string;
  341. 'createdAt'?: string;
  342. 'updatedAt'?: string;
  343. }
  344. type Tag = [object Object];
  345. type tagIds = Record<string, any>;
  346. type tagList =
  347. {
  348. 'data'?: tag[];
  349. /** Paginate through tags by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. */
  350. 'nextCursor'?: string;
  351. }
  352. type updateCredentialParams =
  353. {
  354. /** The credential ID that needs to be updated */
  355. 'id': string;
  356. }
  357. type updateCredentialRequest =
  358. {
  359. /** The name of the credential */
  360. 'name'?: string;
  361. /** The credential type. If changing type, data must also be provided. */
  362. 'type'?: string;
  363. /** The credential data. Required when changing credential type. */
  364. 'data'?: Record<string, any>;
  365. /** Whether this credential is available globally */
  366. 'isGlobal'?: boolean;
  367. /** Whether this credential has resolvable fields */
  368. 'isResolvable'?: boolean;
  369. /** If true, unredacts and merges existing credential data with the provided data. If false, replaces the entire data object. */
  370. 'isPartialData'?: boolean;
  371. }
  372. type user =
  373. {
  374. 'id'?: string;
  375. 'email': string;
  376. /** User's first name */
  377. 'firstName'?: string;
  378. /** User's last name */
  379. 'lastName'?: string;
  380. /** Whether the user finished setting up their account in response to the invitation (true) or not (false). */
  381. 'isPending'?: boolean;
  382. /** Time the user was created. */
  383. 'createdAt'?: string;
  384. /** Last time the user was updated. */
  385. 'updatedAt'?: string;
  386. 'role'?: string;
  387. }
  388. type User = [object Object];
  389. type userList =
  390. {
  391. 'data'?: user[];
  392. /** Paginate through users by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. */
  393. 'nextCursor'?: string;
  394. }
  395. type UserList = [object Object];
  396. type variable =
  397. {
  398. 'id'?: string;
  399. 'key': string;
  400. 'value': string;
  401. 'type'?: string;
  402. 'project'?: project;
  403. }
  404. type variableList =
  405. {
  406. 'data'?: variable[];
  407. /** Paginate through variables by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. */
  408. 'nextCursor'?: string;
  409. }
  410. type workflow =
  411. {
  412. 'id'?: string;
  413. 'name': string;
  414. 'active'?: boolean;
  415. 'createdAt'?: string;
  416. 'updatedAt'?: string;
  417. 'nodes': node[];
  418. 'connections': Record<string, any>;
  419. 'settings': workflowSettings;
  420. 'staticData'?: string | Record<string, any>;
  421. 'tags'?: tag[];
  422. 'shared'?: sharedWorkflow[];
  423. 'activeVersion'?: activeVersion;
  424. }
  425. type Workflow = [object Object];
  426. type workflowList =
  427. {
  428. 'data'?: workflow[];
  429. /** Paginate through workflows by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. */
  430. 'nextCursor'?: string;
  431. }
  432. type WorkflowList = [object Object];
  433. type workflowSettings =
  434. {
  435. 'saveExecutionProgress'?: boolean;
  436. 'saveManualExecutions'?: boolean;
  437. 'saveDataErrorExecution'?: "all" | "none";
  438. 'saveDataSuccessExecution'?: "all" | "none";
  439. 'executionTimeout'?: number;
  440. /** The ID of the workflow that contains the error trigger node. */
  441. 'errorWorkflow'?: string;
  442. 'timezone'?: string;
  443. 'executionOrder'?: string;
  444. /** Controls which workflows are allowed to call this workflow using the Execute Workflow node.
  445. Available options:
  446. - `any`: Any workflow can call this workflow (no restrictions)
  447. - `none`: No other workflows can call this workflow (completely blocked)
  448. - `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow
  449. * For personal projects: Only workflows created by the same user
  450. * For team projects: Only workflows within the same team project
  451. - `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow
  452. * Requires the `callerIds` field to specify which workflow IDs are allowed
  453. * See `callerIds` field documentation for usage
  454. */
  455. 'callerPolicy'?: "any" | "none" | "workflowsFromAList" | "workflowsFromSameOwner";
  456. /** Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy) */
  457. 'callerIds'?: string;
  458. /** Estimated time saved per execution in minutes */
  459. 'timeSavedPerExecution'?: number;
  460. /** Controls whether this workflow is accessible via the Model Context Protocol (MCP).
  461. When enabled, this workflow can be called by MCP clients (AI assistants and other tools
  462. that support MCP). This allows external AI tools to discover and execute this workflow
  463. as part of their capabilities.
  464. Requirements for enabling MCP access:
  465. - The workflow must be active (not deactivated)
  466. - The workflow must contain at least one active Webhook node
  467. - Only webhook-triggered workflows can be exposed via MCP
  468. Security note: When a workflow is available in MCP, it can be discovered and executed
  469. by any MCP client that has the appropriate API credentials for your n8n instance.
  470. */
  471. 'availableInMCP'?: boolean;
  472. }
  473. type WorkflowSettings = [object Object];
  474. type workflowTags = tag[];
  475. type workflowVersion =
  476. {
  477. /** The version ID of this workflow snapshot */
  478. 'versionId': string;
  479. /** The workflow ID this version belongs to */
  480. 'workflowId': string;
  481. /** Nodes as they were in this version */
  482. 'nodes': node[];
  483. /** Connections as they were in this version */
  484. 'connections': Record<string, any>;
  485. /** Authors who created this version */
  486. 'authors': string;
  487. /** Workflow name at this version */
  488. 'name'?: string;
  489. /** Workflow description at this version */
  490. 'description'?: string;
  491. /** When this version was created */
  492. 'createdAt'?: string;
  493. /** When this version was last updated */
  494. 'updatedAt'?: string;
  495. }
  496. }