n8n-nodes-autotask 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +276 -256
  2. package/dist/nodes/Autotask/Autotask.node.js +80 -49
  3. package/dist/nodes/Autotask/Autotask.node.js.map +1 -1
  4. package/dist/nodes/Autotask/constants/entities.js +7 -1
  5. package/dist/nodes/Autotask/constants/entities.js.map +1 -1
  6. package/dist/nodes/Autotask/constants/field.constants.js +2 -0
  7. package/dist/nodes/Autotask/constants/field.constants.js.map +1 -1
  8. package/dist/nodes/Autotask/helpers/cache/init.js +14 -3
  9. package/dist/nodes/Autotask/helpers/cache/init.js.map +1 -1
  10. package/dist/nodes/Autotask/helpers/cache/service.js +9 -0
  11. package/dist/nodes/Autotask/helpers/cache/service.js.map +1 -1
  12. package/dist/nodes/Autotask/helpers/entity/picklist.js +41 -16
  13. package/dist/nodes/Autotask/helpers/entity/picklist.js.map +1 -1
  14. package/dist/nodes/Autotask/helpers/entity-values/value-helper.d.ts +1 -1
  15. package/dist/nodes/Autotask/helpers/entity-values/value-helper.js +8 -7
  16. package/dist/nodes/Autotask/helpers/entity-values/value-helper.js.map +1 -1
  17. package/dist/nodes/Autotask/helpers/resource-operations.helper.js +13 -1
  18. package/dist/nodes/Autotask/helpers/resource-operations.helper.js.map +1 -1
  19. package/dist/nodes/Autotask/operations/base/field-processor.d.ts +4 -0
  20. package/dist/nodes/Autotask/operations/base/field-processor.js +116 -0
  21. package/dist/nodes/Autotask/operations/base/field-processor.js.map +1 -1
  22. package/dist/nodes/Autotask/operations/base/get-many-advanced.operation.js +12 -0
  23. package/dist/nodes/Autotask/operations/base/get-many-advanced.operation.js.map +1 -1
  24. package/dist/nodes/Autotask/operations/base/get-many.js +13 -0
  25. package/dist/nodes/Autotask/operations/base/get-many.js.map +1 -1
  26. package/dist/nodes/Autotask/operations/base/get-operation.js +14 -1
  27. package/dist/nodes/Autotask/operations/base/get-operation.js.map +1 -1
  28. package/dist/nodes/Autotask/operations/common/get-many/description.js +1 -1
  29. package/dist/nodes/Autotask/operations/common/get-many/description.js.map +1 -1
  30. package/dist/nodes/Autotask/operations/common/get-many-advanced/description.js +1 -1
  31. package/dist/nodes/Autotask/operations/common/get-many-advanced/description.js.map +1 -1
  32. package/dist/nodes/Autotask/operations/common/picklist-labels/description.d.ts +3 -0
  33. package/dist/nodes/Autotask/operations/common/picklist-labels/description.js +30 -0
  34. package/dist/nodes/Autotask/operations/common/picklist-labels/description.js.map +1 -0
  35. package/dist/nodes/Autotask/operations/common/picklist-labels/index.d.ts +2 -0
  36. package/dist/nodes/Autotask/operations/common/picklist-labels/index.js +7 -0
  37. package/dist/nodes/Autotask/operations/common/picklist-labels/index.js.map +1 -0
  38. package/dist/nodes/Autotask/resources/billingCodes/description.js +1 -4
  39. package/dist/nodes/Autotask/resources/billingCodes/description.js.map +1 -1
  40. package/dist/nodes/Autotask/resources/companies/description.js +2 -5
  41. package/dist/nodes/Autotask/resources/companies/description.js.map +1 -1
  42. package/dist/nodes/Autotask/resources/companyAlerts/description.d.ts +2 -0
  43. package/dist/nodes/Autotask/resources/companyAlerts/description.js +104 -0
  44. package/dist/nodes/Autotask/resources/companyAlerts/description.js.map +1 -0
  45. package/dist/nodes/Autotask/resources/companyAlerts/execute.d.ts +2 -0
  46. package/dist/nodes/Autotask/resources/companyAlerts/execute.js +83 -0
  47. package/dist/nodes/Autotask/resources/companyAlerts/execute.js.map +1 -0
  48. package/dist/nodes/Autotask/resources/companyAlerts/index.d.ts +1 -0
  49. package/dist/nodes/Autotask/resources/companyAlerts/index.js +18 -0
  50. package/dist/nodes/Autotask/resources/companyAlerts/index.js.map +1 -0
  51. package/dist/nodes/Autotask/resources/companyLocations/description.d.ts +2 -0
  52. package/dist/nodes/Autotask/resources/companyLocations/description.js +102 -0
  53. package/dist/nodes/Autotask/resources/companyLocations/description.js.map +1 -0
  54. package/dist/nodes/Autotask/resources/companyLocations/execute.d.ts +2 -0
  55. package/dist/nodes/Autotask/resources/companyLocations/execute.js +83 -0
  56. package/dist/nodes/Autotask/resources/companyLocations/execute.js.map +1 -0
  57. package/dist/nodes/Autotask/resources/companyLocations/index.d.ts +2 -0
  58. package/dist/nodes/Autotask/resources/companyLocations/index.js +19 -0
  59. package/dist/nodes/Autotask/resources/companyLocations/index.js.map +1 -0
  60. package/dist/nodes/Autotask/resources/companyNotes/description.js +1 -1
  61. package/dist/nodes/Autotask/resources/companyNotes/description.js.map +1 -1
  62. package/dist/nodes/Autotask/resources/contacts/description.js +13 -17
  63. package/dist/nodes/Autotask/resources/contacts/description.js.map +1 -1
  64. package/dist/nodes/Autotask/resources/contacts/execute.js +0 -6
  65. package/dist/nodes/Autotask/resources/contacts/execute.js.map +1 -1
  66. package/dist/nodes/Autotask/resources/contracts/description.d.ts +9 -0
  67. package/dist/nodes/Autotask/resources/contracts/description.js +96 -0
  68. package/dist/nodes/Autotask/resources/contracts/description.js.map +1 -0
  69. package/dist/nodes/Autotask/resources/contracts/execute.d.ts +2 -0
  70. package/dist/nodes/Autotask/resources/contracts/execute.js +77 -0
  71. package/dist/nodes/Autotask/resources/contracts/execute.js.map +1 -0
  72. package/dist/nodes/Autotask/resources/contracts/index.d.ts +2 -0
  73. package/dist/nodes/Autotask/resources/contracts/index.js +19 -0
  74. package/dist/nodes/Autotask/resources/contracts/index.js.map +1 -0
  75. package/dist/nodes/Autotask/resources/definitions.js +30 -0
  76. package/dist/nodes/Autotask/resources/definitions.js.map +1 -1
  77. package/dist/nodes/Autotask/resources/holidaySets/description.d.ts +2 -0
  78. package/dist/nodes/Autotask/resources/holidaySets/description.js +104 -0
  79. package/dist/nodes/Autotask/resources/holidaySets/description.js.map +1 -0
  80. package/dist/nodes/Autotask/resources/holidaySets/execute.d.ts +2 -0
  81. package/dist/nodes/Autotask/resources/holidaySets/execute.js +83 -0
  82. package/dist/nodes/Autotask/resources/holidaySets/execute.js.map +1 -0
  83. package/dist/nodes/Autotask/resources/holidaySets/index.d.ts +2 -0
  84. package/dist/nodes/Autotask/resources/holidaySets/index.js +19 -0
  85. package/dist/nodes/Autotask/resources/holidaySets/index.js.map +1 -0
  86. package/dist/nodes/Autotask/resources/holidays/description.d.ts +2 -0
  87. package/dist/nodes/Autotask/resources/holidays/description.js +102 -0
  88. package/dist/nodes/Autotask/resources/holidays/description.js.map +1 -0
  89. package/dist/nodes/Autotask/resources/holidays/execute.d.ts +2 -0
  90. package/dist/nodes/Autotask/resources/holidays/execute.js +94 -0
  91. package/dist/nodes/Autotask/resources/holidays/execute.js.map +1 -0
  92. package/dist/nodes/Autotask/resources/holidays/index.d.ts +2 -0
  93. package/dist/nodes/Autotask/resources/holidays/index.js +19 -0
  94. package/dist/nodes/Autotask/resources/holidays/index.js.map +1 -0
  95. package/dist/nodes/Autotask/resources/products/description.js +1 -1
  96. package/dist/nodes/Autotask/resources/products/description.js.map +1 -1
  97. package/dist/nodes/Autotask/resources/projectCharges/description.js +1 -1
  98. package/dist/nodes/Autotask/resources/projectCharges/description.js.map +1 -1
  99. package/dist/nodes/Autotask/resources/projectNotes/description.js +1 -1
  100. package/dist/nodes/Autotask/resources/projectNotes/description.js.map +1 -1
  101. package/dist/nodes/Autotask/resources/projectPhases/description.js +1 -1
  102. package/dist/nodes/Autotask/resources/projectPhases/description.js.map +1 -1
  103. package/dist/nodes/Autotask/resources/projects/description.js +1 -1
  104. package/dist/nodes/Autotask/resources/projects/description.js.map +1 -1
  105. package/dist/nodes/Autotask/resources/serviceCalls/description.d.ts +2 -0
  106. package/dist/nodes/Autotask/resources/serviceCalls/description.js +104 -0
  107. package/dist/nodes/Autotask/resources/serviceCalls/description.js.map +1 -0
  108. package/dist/nodes/Autotask/resources/serviceCalls/execute.d.ts +2 -0
  109. package/dist/nodes/Autotask/resources/serviceCalls/execute.js +83 -0
  110. package/dist/nodes/Autotask/resources/serviceCalls/execute.js.map +1 -0
  111. package/dist/nodes/Autotask/resources/serviceCalls/index.d.ts +2 -0
  112. package/dist/nodes/Autotask/resources/serviceCalls/index.js +19 -0
  113. package/dist/nodes/Autotask/resources/serviceCalls/index.js.map +1 -0
  114. package/dist/nodes/Autotask/resources/ticketNotes/description.js +1 -1
  115. package/dist/nodes/Autotask/resources/ticketNotes/description.js.map +1 -1
  116. package/dist/nodes/Autotask/resources/tickets/description.js +1 -1
  117. package/dist/nodes/Autotask/resources/tickets/description.js.map +1 -1
  118. package/dist/nodes/Autotask/resources/timeEntries/description.js +1 -1
  119. package/dist/nodes/Autotask/resources/timeEntries/description.js.map +1 -1
  120. package/dist/package.json +2 -2
  121. package/dist/tsconfig.tsbuildinfo +1 -1
  122. package/package.json +2 -2
package/README.md CHANGED
@@ -1,256 +1,276 @@
1
- # n8n-nodes-autotask
2
-
3
- ![n8n-nodes-autotask](https://img.shields.io/badge/n8n--nodes--autotask-0.2.0-blue)
4
- ![License](https://img.shields.io/badge/license-MIT-green)
5
-
6
- This is an n8n community node for integrating with Autotask PSA. It provides a comprehensive set of operations to interact with Autotask entities through their REST API.
7
-
8
- ![Overview of n8n-nodes-autotask](./overview.gif)
9
-
10
- [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
11
-
12
- [Installation](#installation)
13
- [Authentication](#authentication)
14
- [Features](#features)
15
- [Usage](#usage)
16
- [Configuration](#configuration)
17
- [Limitations](#limitations)
18
- [Troubleshooting](#troubleshooting)
19
- [Resources](#resources)
20
- [License](#license)
21
-
22
- ## Installation
23
-
24
- Follow these steps to install this node:
25
-
26
- ```bash
27
- # Install with npm
28
- npm install n8n-nodes-autotask
29
-
30
- # Install with pnpm
31
- pnpm install n8n-nodes-autotask
32
- ```
33
-
34
- **Requirements:**
35
- - n8n version 1.0.0 or later
36
- - Node.js version 18.10 or later
37
- - pnpm version 9.1 or later (if using pnpm)
38
-
39
- ## Authentication
40
-
41
- To use this node, you need to have API access to your Autotask instance. Follow these steps to set up authentication:
42
-
43
- 1. In Autotask, go to **Admin > API User Security**
44
- 2. Create or select an API user
45
- 3. Note the API Integration Code, Username, and Secret
46
- 4. In n8n, create a new credential of type **Autotask API**
47
- 5. Enter your API Integration Code, Username, and Secret
48
- 6. Select your Autotask zone
49
- 7. Select your timezone (affects how dates and times are displayed and entered)
50
- 8. Configure caching options as needed (this will cache dynamically fetched field picklists)
51
-
52
- ## Features
53
-
54
- ### Supported Resources
55
-
56
- The node supports the following Autotask resources:
57
-
58
- | Resource | Description |
59
- |----------|-------------|
60
- | Billing Code | Manage billing codes for time entries and charges |
61
- | Company | Manage organisations in Autotask |
62
- | Company Note | Manage notes attached to companies |
63
- | Contact | Manage contacts associated with companies |
64
- | Product | Manage products in the catalogue |
65
- | Project | Manage projects |
66
- | Project Charge | Manage charges associated with projects |
67
- | Project Note | Manage notes attached to projects |
68
- | Project Phase | Manage phases within projects |
69
- | Project Task | Manage tasks within projects |
70
- | Resource | Manage staff resources |
71
- | Search Filter | Build advanced search filters |
72
- | Ticket | Manage service tickets |
73
- | Ticket History | View historical changes to tickets |
74
- | Ticket Note | Manage notes attached to tickets |
75
- | Time Entry | Manage time entries for billing |
76
-
77
- ### Operations
78
-
79
- For most resources, the following operations are available:
80
-
81
- - **Create**: Add new records
82
- - **Read**: Retrieve a single record by ID
83
- - **Update**: Modify existing records
84
- - **Delete**: Remove records
85
- - **Get Many**: Retrieve multiple records with basic filtering options. This operation allows you to:
86
- - Filter records using simple field conditions (equals)
87
- - Filtering on User Defined Fields (UDFs)
88
- - Automatically paginate through large result sets
89
- - Choose to get all results or limit to a specific number (1-500)
90
- - Set a maximum number of records to return when not retrieving all records
91
- - **Get Many Advanced**: Build complex queries with multiple filter conditions and logical operators. This operation provides:
92
- - Support for complex AND/OR logic in filters
93
- - Nested condition groups for sophisticated queries
94
- - Filtering on User Defined Fields (UDFs)
95
- - Advanced operators like contains, beginsWith, endsWith, exists, notExists
96
- - Support for IN and NOT IN operators with multiple values
97
- - Choose to get all results or limit to a specific number (1-500)
98
- - Set a maximum number of records to return when not retrieving all records
99
- - **Count**: Get the number of matching records
100
- - **Get Entity Info**: Retrieve metadata about the entity
101
- - **Get Field Info**: Retrieve field definitions for the selected entity
102
-
103
- ### Advanced Features
104
-
105
- - **Resource Mapping**: Dynamically map fields based on entity definitions
106
- - **Advanced Filtering**: Build complex queries with multiple conditions
107
- - **File-based Caching**: Improved performance with persistent caching that can be shared between workflows and runs
108
- - **Timezone Handling**: Automatic conversion between local time and UTC
109
-
110
- ## Usage
111
-
112
- ### Basic Example: Creating a Ticket
113
-
114
- 1. Add an **Autotask** node to your workflow
115
- 2. Select **Ticket** as the resource
116
- 3. Select **Create** as the operation
117
- 4. Configure the required fields (Title, Status, etc.)
118
- 5. Connect to a trigger or previous node
119
- 6. Execute the workflow
120
-
121
- ### Intermediate Example: Querying Projects with Filters
122
-
123
- 1. Add an **Autotask** node to your workflow
124
- 2. Select **Project** as the resource
125
- 3. Select **Get Many** as the operation
126
- 4. Add filter conditions (e.g., Status equals "Active")
127
- 5. Choose whether to retrieve all results or limit the number:
128
- - Toggle "Get All" to true to retrieve all matching records
129
- - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
130
- 6. Connect to a trigger or previous node
131
- 7. Execute the workflow
132
-
133
- ### Advanced Example: Complex Filtering with Get Many Advanced
134
-
135
- 1. Add an **Autotask** node to your workflow
136
- 2. Select **Ticket** as the resource
137
- 3. Select **Get Many Advanced** as the operation
138
- 4. Build a complex filter, for example:
139
- ```json
140
- {
141
- "op": "and",
142
- "items": [
143
- {
144
- "field": "Status",
145
- "op": "notEqual",
146
- "value": 5
147
- },
148
- {
149
- "op": "or",
150
- "items": [
151
- {
152
- "field": "Priority",
153
- "op": "Equal",
154
- "value": 6
155
- },
156
- {
157
- "field": "DueDateTime",
158
- "op": "lessThan",
159
- "value": "{{ $now.plus(3, 'days').toLocal()}}"
160
- }
161
- ]
162
- }
163
- ]
164
- }
165
- ```
166
- 5. Choose whether to retrieve all results or limit the number:
167
- - Toggle "Get All" to true to retrieve all matching records
168
- - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
169
- 6. Execute the workflow to retrieve tickets that are not complete AND either have priority 6 OR are due within the next 3 days
170
-
171
- ### Advanced Example: Working with Parent-Child Relationships
172
-
173
- Many Autotask entities have parent-child relationships (e.g., Companies and Contacts). To work with these:
174
-
175
- 1. First, retrieve or create the parent entity
176
- 2. Use the parent entity's ID in the child entity operations
177
- 3. For example, to create a Contact for a Company:
178
- - First node: Get or create the Company
179
- - Second node: Create a Contact with the Company ID
180
-
181
- ## Configuration
182
-
183
- ### Caching Options
184
-
185
- The node includes an enhanced file-based caching system to improve performance by reducing API calls:
186
-
187
- - **Enable Field Caching**: Toggle caching on/off
188
- - **Cache TTL**: How long to cache field values (in seconds)
189
- - **Cache Entity Info**: Whether to cache entity information and field definitions
190
- - **Entity Info TTL**: How long to cache entity information
191
- - **Cache Reference Fields**: Whether to cache reference field values
192
- - **Reference Fields TTL**: How long to cache reference field values
193
- - **Cache Picklists**: Whether to cache picklist values
194
- - **Picklists TTL**: How long to cache picklist values
195
- - **File-based Cache**: Cache is stored in files that can be shared between workflows and runs
196
- - **Cache Directory**: Optional path to a directory where cache files will be stored
197
-
198
- ### Timezone Handling
199
-
200
- All dates and times in the Autotask API are in UTC. The node automatically converts between your selected timezone and UTC:
201
-
202
- - When creating or updating records, local times are converted to UTC
203
- - When retrieving records, UTC times are converted to your local timezone
204
- - The timezone is configured in the credentials
205
-
206
- ## Limitations
207
-
208
- ### API Limits
209
-
210
- - Maximum 500 records per page in query results
211
- - Maximum 50 pages per query operation
212
- - Maximum 500 OR conditions in filters
213
- - Maximum 1 User Defined Field per query
214
-
215
- ### Entity-Specific Limitations
216
-
217
- - Some entities may not support all operations (e.g., Project Phases cannot be deleted)
218
- - Parent-child relationships require specific handling
219
- - Some fields may be read-only or have specific validation rules
220
-
221
- ### Performance Considerations
222
-
223
- - Large queries may be slow and should be optimised with filters
224
- - Complex workflows with many API calls may hit rate limits
225
-
226
- ## Troubleshooting
227
-
228
- ### Common Issues
229
-
230
- - **Authentication Errors**: Verify your API credentials and ensure the API user has appropriate permissions
231
- - **Field Validation Errors**: Check field requirements in the Autotask API documentation
232
- - **Rate Limiting**: If you encounter rate limiting, reduce the frequency of API calls or implement retry logic
233
-
234
- ### Reporting Bugs
235
-
236
- If you encounter any bugs or issues with this integration:
237
-
238
- 1. Check the [GitHub Issues](https://github.com/msoukhomlinov/n8n-nodes-autotask/issues) to see if the problem has already been reported
239
- 2. If not, please submit a new issue with:
240
- - A clear description of the problem
241
- - Steps to reproduce the issue
242
- - Expected vs actual behaviour
243
- - Your environment details (n8n version, Node.js version)
244
- - Any relevant error messages or screenshots
245
-
246
- Bug reports should be submitted via GitHub at: https://github.com/msoukhomlinov/n8n-nodes-autotask/issues
247
-
248
- ## Resources
249
-
250
- - [Autotask API Documentation](https://ww6.autotask.net/help/developerhelp/Content/APIs/REST/REST_API_Home.htm)
251
- - [n8n Documentation](https://docs.n8n.io/)
252
- - [GitHub Repository](https://github.com/msoukhomlinov/n8n-nodes-autotask)
253
-
254
- ## License
255
-
256
- [MIT](LICENSE)
1
+ # n8n-nodes-autotask
2
+
3
+ ![n8n-nodes-autotask](https://img.shields.io/badge/n8n--nodes--autotask-0.2.0-blue)
4
+ ![License](https://img.shields.io/badge/license-MIT-green)
5
+
6
+ This is an n8n community node for integrating with Autotask PSA. It provides a comprehensive set of operations to interact with Autotask entities through their REST API.
7
+
8
+ ![Overview of n8n-nodes-autotask](./overview.gif)
9
+
10
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
11
+
12
+ [Installation](#installation)
13
+ [Authentication](#authentication)
14
+ [Features](#features)
15
+ [Usage](#usage)
16
+ [Configuration](#configuration)
17
+ [Limitations](#limitations)
18
+ [Troubleshooting](#troubleshooting)
19
+ [Resources](#resources)
20
+ [License](#license)
21
+
22
+ ## Installation
23
+
24
+ Follow these steps to install this node:
25
+
26
+ ```bash
27
+ # Install with npm
28
+ npm install n8n-nodes-autotask
29
+
30
+ # Install with pnpm
31
+ pnpm install n8n-nodes-autotask
32
+ ```
33
+
34
+ **Requirements:**
35
+ - n8n version 1.0.0 or later
36
+ - Node.js version 18.10 or later
37
+ - pnpm version 9.1 or later (if using pnpm)
38
+
39
+ ## Authentication
40
+
41
+ To use this node, you need to have API access to your Autotask instance. Follow these steps to set up authentication:
42
+
43
+ 1. In Autotask, go to **Admin > API User Security**
44
+ 2. Create or select an API user
45
+ 3. Note the API Integration Code, Username, and Secret
46
+ 4. In n8n, create a new credential of type **Autotask API**
47
+ 5. Enter your API Integration Code, Username, and Secret
48
+ 6. Select your Autotask zone
49
+ 7. Select your timezone (affects how dates and times are displayed and entered)
50
+ 8. Configure caching options as needed (this will cache dynamically fetched field picklists)
51
+
52
+ ## Features
53
+
54
+ ### Supported Resources
55
+
56
+ The node supports the following Autotask resources:
57
+
58
+ | Resource | Description |
59
+ |----------|-------------|
60
+ | Billing Code | Manage billing codes for time entries and charges |
61
+ | Company | Manage organisations in Autotask |
62
+ | Company Note | Manage notes attached to companies |
63
+ | Contact | Manage contacts associated with companies |
64
+ | Product | Manage products in the catalogue |
65
+ | Project | Manage projects |
66
+ | Project Charge | Manage charges associated with projects |
67
+ | Project Note | Manage notes attached to projects |
68
+ | Project Phase | Manage phases within projects |
69
+ | Project Task | Manage tasks within projects |
70
+ | Resource | Manage staff resources |
71
+ | Search Filter | Build advanced search filters |
72
+ | Ticket | Manage service tickets |
73
+ | Ticket History | View historical changes to tickets |
74
+ | Ticket Note | Manage notes attached to tickets |
75
+ | Time Entry | Manage time entries for billing |
76
+
77
+ ### Operations
78
+
79
+ For most resources, the following operations are available:
80
+
81
+ - **Create**: Add new records
82
+ - **Read**: Retrieve a single record by ID
83
+ - **Update**: Modify existing records
84
+ - **Delete**: Remove records
85
+ - **Get Many**: Retrieve multiple records with basic filtering options. This operation allows you to:
86
+ - Filter records using simple field conditions (equals)
87
+ - Filtering on User Defined Fields (UDFs)
88
+ - Automatically paginate through large result sets
89
+ - Choose to get all results or limit to a specific number (1-500)
90
+ - Set a maximum number of records to return when not retrieving all records
91
+ - **Get Many Advanced**: Build complex queries with multiple filter conditions and logical operators. This operation provides:
92
+ - Support for complex AND/OR logic in filters
93
+ - Nested condition groups for sophisticated queries
94
+ - Filtering on User Defined Fields (UDFs)
95
+ - Advanced operators like contains, beginsWith, endsWith, exists, notExists
96
+ - Support for IN and NOT IN operators with multiple values
97
+ - Choose to get all results or limit to a specific number (1-500)
98
+ - Set a maximum number of records to return when not retrieving all records
99
+ - **Count**: Get the number of matching records
100
+ - **Get Entity Info**: Retrieve metadata about the entity
101
+ - **Get Field Info**: Retrieve field definitions for the selected entity
102
+
103
+ ### Advanced Features
104
+
105
+ - **Resource Mapping**: Dynamically map fields based on entity definitions
106
+ - **Advanced Filtering**: Build complex queries with multiple conditions
107
+ - **File-based Caching**: Improved performance with persistent caching that can be shared between workflows and runs
108
+ - **Timezone Handling**: Automatic conversion between local time and UTC
109
+
110
+ ### AI Tool Integration
111
+
112
+ This node can be used as a tool by AI agents in n8n workflows. This allows AI agents to interact with Autotask PSA, performing operations like retrieving company information, creating tickets, or updating contacts.
113
+
114
+ #### Requirements
115
+
116
+ Currently, n8n only allows core nodes to be used as tools by default. To use this community node as a tool, you need to:
117
+
118
+ 1. Set the environment variable `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE` to `true` when running n8n.
119
+ 2. Add the Autotask node as a tool in your AI agent workflow.
120
+
121
+ #### Example AI Tool Usage
122
+
123
+ An AI agent might use the Autotask node to:
124
+ - Retrieve information about a company or contact
125
+ - Create a new ticket based on user input
126
+ - Update the status of an existing ticket
127
+ - Add notes to a ticket or company record
128
+ - Search for tickets matching specific criteria
129
+
130
+ ## Usage
131
+
132
+ ### Basic Example: Creating a Ticket
133
+
134
+ 1. Add an **Autotask** node to your workflow
135
+ 2. Select **Ticket** as the resource
136
+ 3. Select **Create** as the operation
137
+ 4. Configure the required fields (Title, Status, etc.)
138
+ 5. Connect to a trigger or previous node
139
+ 6. Execute the workflow
140
+
141
+ ### Intermediate Example: Querying Projects with Filters
142
+
143
+ 1. Add an **Autotask** node to your workflow
144
+ 2. Select **Project** as the resource
145
+ 3. Select **Get Many** as the operation
146
+ 4. Add filter conditions (e.g., Status equals "Active")
147
+ 5. Choose whether to retrieve all results or limit the number:
148
+ - Toggle "Get All" to true to retrieve all matching records
149
+ - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
150
+ 6. Connect to a trigger or previous node
151
+ 7. Execute the workflow
152
+
153
+ ### Advanced Example: Complex Filtering with Get Many Advanced
154
+
155
+ 1. Add an **Autotask** node to your workflow
156
+ 2. Select **Ticket** as the resource
157
+ 3. Select **Get Many Advanced** as the operation
158
+ 4. Build a complex filter, for example:
159
+ ```json
160
+ {
161
+ "op": "and",
162
+ "items": [
163
+ {
164
+ "field": "Status",
165
+ "op": "notEqual",
166
+ "value": 5
167
+ },
168
+ {
169
+ "op": "or",
170
+ "items": [
171
+ {
172
+ "field": "Priority",
173
+ "op": "Equal",
174
+ "value": 6
175
+ },
176
+ {
177
+ "field": "DueDateTime",
178
+ "op": "lessThan",
179
+ "value": "{{ $now.plus(3, 'days').toLocal()}}"
180
+ }
181
+ ]
182
+ }
183
+ ]
184
+ }
185
+ ```
186
+ 5. Choose whether to retrieve all results or limit the number:
187
+ - Toggle "Get All" to true to retrieve all matching records
188
+ - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
189
+ 6. Execute the workflow to retrieve tickets that are not complete AND either have priority 6 OR are due within the next 3 days
190
+
191
+ ### Advanced Example: Working with Parent-Child Relationships
192
+
193
+ Many Autotask entities have parent-child relationships (e.g., Companies and Contacts). To work with these:
194
+
195
+ 1. First, retrieve or create the parent entity
196
+ 2. Use the parent entity's ID in the child entity operations
197
+ 3. For example, to create a Contact for a Company:
198
+ - First node: Get or create the Company
199
+ - Second node: Create a Contact with the Company ID
200
+
201
+ ## Configuration
202
+
203
+ ### Caching Options
204
+
205
+ The node includes an enhanced file-based caching system to improve performance by reducing API calls:
206
+
207
+ - **Enable Field Caching**: Toggle caching on/off
208
+ - **Cache TTL**: How long to cache field values (in seconds)
209
+ - **Cache Entity Info**: Whether to cache entity information and field definitions
210
+ - **Entity Info TTL**: How long to cache entity information
211
+ - **Cache Reference Fields**: Whether to cache reference field values
212
+ - **Reference Fields TTL**: How long to cache reference field values
213
+ - **Cache Picklists**: Whether to cache picklist values
214
+ - **Picklists TTL**: How long to cache picklist values
215
+ - **File-based Cache**: Cache is stored in files that can be shared between workflows and runs
216
+ - **Cache Directory**: Optional path to a directory where cache files will be stored
217
+
218
+ ### Timezone Handling
219
+
220
+ All dates and times in the Autotask API are in UTC. The node automatically converts between your selected timezone and UTC:
221
+
222
+ - When creating or updating records, local times are converted to UTC
223
+ - When retrieving records, UTC times are converted to your local timezone
224
+ - The timezone is configured in the credentials
225
+
226
+ ## Limitations
227
+
228
+ ### API Limits
229
+
230
+ - Maximum 500 records per page in query results
231
+ - Maximum 50 pages per query operation
232
+ - Maximum 500 OR conditions in filters
233
+ - Maximum 1 User Defined Field per query
234
+
235
+ ### Entity-Specific Limitations
236
+
237
+ - Some entities may not support all operations (e.g., Project Phases cannot be deleted)
238
+ - Parent-child relationships require specific handling
239
+ - Some fields may be read-only or have specific validation rules
240
+
241
+ ### Performance Considerations
242
+
243
+ - Large queries may be slow and should be optimised with filters
244
+ - Complex workflows with many API calls may hit rate limits
245
+
246
+ ## Troubleshooting
247
+
248
+ ### Common Issues
249
+
250
+ - **Authentication Errors**: Verify your API credentials and ensure the API user has appropriate permissions
251
+ - **Field Validation Errors**: Check field requirements in the Autotask API documentation
252
+ - **Rate Limiting**: If you encounter rate limiting, reduce the frequency of API calls or implement retry logic
253
+
254
+ ### Reporting Bugs
255
+
256
+ If you encounter any bugs or issues with this integration:
257
+
258
+ 1. Check the [GitHub Issues](https://github.com/msoukhomlinov/n8n-nodes-autotask/issues) to see if the problem has already been reported
259
+ 2. If not, please submit a new issue with:
260
+ - A clear description of the problem
261
+ - Steps to reproduce the issue
262
+ - Expected vs actual behaviour
263
+ - Your environment details (n8n version, Node.js version)
264
+ - Any relevant error messages or screenshots
265
+
266
+ Bug reports should be submitted via GitHub at: https://github.com/msoukhomlinov/n8n-nodes-autotask/issues
267
+
268
+ ## Resources
269
+
270
+ - [Autotask API Documentation](https://ww6.autotask.net/help/developerhelp/Content/APIs/REST/REST_API_Home.htm)
271
+ - [n8n Documentation](https://docs.n8n.io/)
272
+ - [GitHub Repository](https://github.com/msoukhomlinov/n8n-nodes-autotask)
273
+
274
+ ## License
275
+
276
+ [MIT](LICENSE)