n8n-nodes-autotask 0.9.2 → 0.9.3

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.
package/README.md CHANGED
@@ -1,483 +1,484 @@
1
- # n8n-nodes-autotask
2
-
3
- ![n8n-nodes-autotask](https://img.shields.io/badge/n8n--nodes--autotask-0.9.1-blue)
4
- ![License](https://img.shields.io/badge/license-MIT-green)
5
-
6
- [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow.svg)](https://buymeacoffee.com/msoukhomlinov)
7
-
8
- > **IMPORTANT**: After updating this node to a new version, a restart of your n8n instance is highly recommended to ensure all changes are properly applied.
9
-
10
- 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.
11
-
12
- ![Overview of n8n-nodes-autotask](./overview.gif)
13
-
14
- [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
15
-
16
- [Installation](#installation)
17
- [Authentication](#authentication)
18
- [Features](#features)
19
- [Usage](#usage)
20
- [Configuration](#configuration)
21
- [Limitations](#limitations)
22
- [Troubleshooting](#troubleshooting)
23
- [Resources](#resources)
24
- [Support](#support)
25
- [License](#license)
26
-
27
- ## Installation
28
-
29
- Follow these steps to install this node:
30
-
31
- ```bash
32
- # Install with npm
33
- npm install n8n-nodes-autotask
34
-
35
- # Install with pnpm
36
- pnpm install n8n-nodes-autotask
37
- ```
38
-
39
- **Requirements:**
40
- - n8n version 1.0.0 or later
41
- - Node.js version 18.10 or later
42
- - pnpm version 9.1 or later (if using pnpm)
43
-
44
- ## Authentication
45
-
46
- To use this node, you need to have API access to your Autotask instance. Follow these steps to set up authentication:
47
-
48
- 1. In Autotask, go to **Admin > API User Security**
49
- 2. Create or select an API user
50
- 3. Note the API Integration Code, Username, and Secret
51
- 4. In n8n, create a new credential of type **Autotask API**
52
- 5. Enter your API Integration Code, Username, and Secret
53
- 6. Select your Autotask zone
54
- 7. Select your timezone (affects how dates and times are displayed and entered)
55
- 8. Configure caching options as needed (this will cache dynamically fetched field picklists)
56
-
57
- ## Features
58
-
59
- ### Supported Resources
60
-
61
- The node supports the following Autotask resources:
62
-
63
- | Resource | Description |
64
- |----------|-------------|
65
- | API Threshold | Check Autotask API usage limits and current usage levels |
66
- | Billing Code | Manage billing codes for time entries and charges |
67
- | Company | Manage organisations in Autotask |
68
- | Company Alert | Manage alerts associated with companies |
69
- | Company Location | Manage locations for companies |
70
- | Company Note | Manage notes attached to companies |
71
- | Company Webhook | Manage webhooks for company events |
72
- | Configuration Item | Manage configuration items (CIs) for companies |
73
- | Configuration Item Billing Product Association | Manage product associations for configuration items |
74
- | Configuration Item Category | Manage categories for configuration items |
75
- | Configuration Item Category UDF Association | Manage UDF associations for CI categories |
76
- | Configuration Item DNS Record | Manage DNS records for configuration items |
77
- | Configuration Item Note | Manage notes for configuration items |
78
- | Configuration Item Related Item | Manage related items for configuration items |
79
- | Configuration Item SSL Subject Alternative Name | Manage SSL alternative names for configuration items |
80
- | Configuration Item Type | Manage types for configuration items |
81
- | Configuration Item Webhook | Manage webhooks for configuration item events |
82
- | Contact | Manage contacts associated with companies |
83
- | Contact Groups | Manage contact groups |
84
- | Contact Group Contacts | Manage contacts within contact groups |
85
- | Contact Webhook | Manage webhooks for contact events |
86
- | Contract | Manage contracts for companies |
87
- | Contract Billing Rules | Manage billing rules for contracts |
88
- | Contract Block | Manage block hour contracts |
89
- | Contract Block Hour Factor | Manage hour factors for block hour contracts |
90
- | Contract Charge | Manage charges associated with contracts |
91
- | Contract Exclusion Billing Codes | Manage excluded billing codes for contracts |
92
- | Contract Exclusion Roles | Manage excluded roles for contracts |
93
- | Contract Exclusion Set Excluded Roles | Manage excluded roles within exclusion sets |
94
- | Contract Exclusion Set Excluded Work Types | Manage excluded work types within exclusion sets |
95
- | Contract Exclusion Sets | Manage exclusion sets for contracts |
96
- | Contract Milestone | Manage milestones for contracts |
97
- | Contract Note | Manage notes attached to contracts |
98
- | Contract Rate | Manage rates for contract services |
99
- | Contract Retainers | Manage retainers for contracts |
100
- | Contract Role Costs | Manage role costs for contracts |
101
- | Contract Service | Manage services within contracts |
102
- | Contract Service Adjustments | Manage adjustments for contract services |
103
- | Contract Service Bundle Adjustments | Manage adjustments for service bundles |
104
- | Contract Service Bundles | Manage service bundles within contracts |
105
- | Contract Service Bundle Units | Manage service bundle units |
106
- | Contract Service Unit | Manage service units for contracts |
107
- | Contract Ticket Purchases | Manage ticket purchases for contracts |
108
- | Countries | Query countries, which are used in address information for companies, contacts, and resources |
109
- | Domain Registrars | Manage domain registrars |
110
- | Holiday | Manage holiday dates |
111
- | Holiday Set | Manage holiday sets for resources |
112
- | Invoices | Manage invoices |
113
- | Notification History | View notification history |
114
- | Opportunity | Manage sales opportunities |
115
- | Product | Manage products in the catalogue |
116
- | Product Vendors | Manage vendor associations for products |
117
- | Project | Manage projects |
118
- | Project Charge | Manage charges associated with projects |
119
- | Project Note | Manage notes attached to projects |
120
- | Project Phase | Manage phases within projects |
121
- | Project Task | Manage tasks within projects |
122
- | Quote | Manage quotes for opportunities with pricing for products, services, and labor |
123
- | Quote Item | Manage line items for quotes including products, services, and labor |
124
- | Quote Location | Manage shipping and billing address information for quotes |
125
- | Quote Template | Query quote templates that define content and appearance of quotes |
126
- | Resource | Manage staff resources |
127
- | Resource Role | Manage department/role relationships, service desk queues, and service desk roles |
128
- | Roles | Manage roles in the system |
129
- | Search Filter | Build advanced search filters |
130
- | Service | Manage services offered to clients |
131
- | Service Call | Manage service calls |
132
- | Service Call Task | Manage tasks associated with service calls |
133
- | Service Call Task Resource | Manage resources assigned to service call tasks |
134
- | Service Call Ticket | Manage tickets linked to service calls |
135
- | Service Call Ticket Resource | Manage resources assigned to service call tickets |
136
- | Survey | Manage customer surveys |
137
- | Survey Results | Manage results from customer surveys |
138
- | Ticket | Manage service tickets |
139
- | Ticket History | View historical changes to tickets |
140
- | Ticket Note | Manage notes attached to tickets |
141
- | Ticket Note Webhook | Manage webhooks for ticket note events |
142
- | Ticket Webhook | Manage webhooks for ticket events |
143
- | Time Entry | Manage time entries for billing |
144
-
145
- ### Operations
146
-
147
- For most resources, the following operations are available:
148
-
149
- - **Create**: Add new records
150
- - **Read**: Retrieve a single record by ID
151
- - **Update**: Modify existing records
152
- - **Delete**: Remove records
153
- - **Get Many**: Retrieve multiple records with basic filtering options. This operation allows you to:
154
- - Filter records using simple field conditions (equals)
155
- - Filtering on User Defined Fields (UDFs)
156
- - Automatically paginate through large result sets
157
- - Choose to get all results or limit to a specific number (1-500)
158
- - Set a maximum number of records to return when not retrieving all records
159
- - Select specific columns to return in the response
160
- - Add human-readable labels for picklist and reference fields
161
- - Flatten User-Defined Fields for easier access in workflows
162
- - **Get Many Advanced**: Build complex queries with multiple filter conditions and logical operators. This operation provides:
163
- - Support for complex AND/OR logic in filters
164
- - Nested condition groups for sophisticated queries
165
- - Filtering on User Defined Fields (UDFs)
166
- - Advanced operators like contains, beginsWith, endsWith, exists, notExists
167
- - Support for IN and NOT IN operators with multiple values
168
- - Choose to get all results or limit to a specific number (1-500)
169
- - Set a maximum number of records to return when not retrieving all records
170
- - Select specific columns to return in the response
171
- - Add human-readable labels for picklist and reference fields
172
- - Flatten User-Defined Fields for easier access in workflows
173
- - Date-based filtering with automatic timezone handling
174
- - **Count**: Get the number of matching records
175
- - **Get Entity Info**: Retrieve metadata about the entity
176
- - **Get Field Info**: Retrieve field definitions for the selected entity
177
-
178
- For webhook resources (Company Webhook, Contact Webhook, Configuration Item Webhook, Ticket Webhook, Ticket Note Webhook), the following operations are available:
179
- - **Get**: Retrieve a single webhook by ID
180
- - **Get Many**: Retrieve multiple webhooks with basic filtering
181
- - **Delete**: Remove a webhook
182
-
183
- ### Webhook Trigger
184
-
185
- The node includes an Autotask Trigger node that can receive webhook events from Autotask. The trigger supports:
186
-
187
- - Events for multiple entity types (Companies, Contacts, Tickets, Configuration Items, Ticket Notes)
188
- - Create, Update, and Delete events
189
- - Field selection for webhook payloads (specify which fields to include)
190
- - Resource exclusion (exclude specific resources from triggering the workflow)
191
- - Email notifications for webhook delivery failures
192
- - Threshold notifications for monitoring webhook performance
193
- - Automatic webhook registration and cleanup
194
- - Secure payload verification with HMAC signatures
195
-
196
- ### Advanced Features
197
-
198
- - **Resource Mapping**: Dynamically map fields based on entity definitions
199
- - **Advanced Filtering**: Build complex queries with multiple conditions
200
- - **Column Selection**: Choose specific fields to return in get operations
201
- - **Picklist Label Enrichment**: Automatically add human-readable labels for picklist fields
202
- - **Reference Label Enrichment**: Add human-readable labels for reference fields
203
- - **UDF Flattening**: Bring user-defined fields up to the top level of response objects for easier access
204
- - **File-based Caching**: Improved performance with persistent caching that can be shared between workflows and runs
205
- - **Timezone Handling**: Automatic conversion between local time and UTC
206
- - **API Usage Monitoring**: Check current API usage thresholds and limits using the API Threshold resource to help prevent hitting rate limits and ensure smooth operations
207
-
208
- ### API Threshold Resource
209
-
210
- The API Threshold resource provides a simple way to monitor your Autotask API usage limits and current consumption. This helps users:
211
- - Track how many API requests have been made in the current timeframe
212
- - See the maximum allowed requests (threshold limit)
213
- - View the usage as a percentage and categorized level (Normal, Moderate, High, Critical)
214
- - Calculate remaining available requests
215
- - Monitor timeframe duration for rate limits
216
-
217
- This is particularly useful for workflows that make many API calls, allowing you to implement conditional logic based on current usage levels to avoid hitting rate limits and ensure continuous operation.
218
-
219
- ### AI Tool Integration
220
-
221
- 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.
222
-
223
- #### Requirements
224
-
225
- Currently, n8n only allows core nodes to be used as tools by default. To use this community node as a tool, you need to:
226
-
227
- 1. Set the environment variable `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE` to `true` when running n8n.
228
- 2. Add the Autotask node as a tool in your AI agent workflow.
229
-
230
- #### Environment Variable Configuration
231
-
232
- For the node to be usable as an AI tool, you must set the following environment variable:
233
-
234
- ```bash
235
- N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
236
- ```
237
-
238
- This can be done by:
239
- - Adding it to your .env file
240
- - Setting it in your system environment variables
241
- - Including it in your Docker or container configuration
242
- - Adding it to your startup command (e.g., `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true n8n start`)
243
-
244
- Without this environment variable set to `true`, n8n will not allow AI agents to use this community node as a tool.
245
-
246
- #### Example AI Tool Usage
247
-
248
- An AI agent might use the Autotask node to:
249
- - Retrieve information about a company or contact
250
- - Create a new ticket based on user input
251
- - Update the status of an existing ticket
252
- - Add notes to a ticket or company record
253
- - Search for tickets matching specific criteria
254
-
255
- ## Usage
256
-
257
- ### Basic Example: Creating a Ticket
258
-
259
- 1. Add an **Autotask** node to your workflow
260
- 2. Select **Ticket** as the resource
261
- 3. Select **Create** as the operation
262
- 4. Configure the required fields (Title, Status, etc.)
263
- 5. Connect to a trigger or previous node
264
- 6. Execute the workflow
265
-
266
- ### Intermediate Example: Querying Projects with Filters
267
-
268
- 1. Add an **Autotask** node to your workflow
269
- 2. Select **Project** as the resource
270
- 3. Select **Get Many** as the operation
271
- 4. Add filter conditions (e.g., Status equals "Active")
272
- 5. Choose whether to retrieve all results or limit the number:
273
- - Toggle "Get All" to true to retrieve all matching records
274
- - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
275
- 6. Connect to a trigger or previous node
276
- 7. Execute the workflow
277
-
278
- ### Advanced Example: Using Column Selection and Reference Labels
279
-
280
- 1. Add an **Autotask** node to your workflow
281
- 2. Select **Ticket** as the resource
282
- 3. Select **Get Many** as the operation
283
- 4. Add filter conditions as needed
284
- 5. Enable **Select Columns** to choose specific fields to return
285
- 6. Select only the fields you need in the response (improves performance)
286
- 7. Enable **Add Picklist Labels** to get human-readable values for picklist fields
287
- 8. Enable **Add Reference Labels** to get human-readable values for reference fields
288
- 9. Enable **Flatten User-Defined Fields** to bring UDFs to the top level of response objects
289
- 10. Execute the workflow to get tickets with only the selected fields and human-readable labels
290
-
291
- ### Advanced Example: Complex Filtering with Get Many Advanced
292
-
293
- 1. Add an **Autotask** node to your workflow
294
- 2. Select **Ticket** as the resource
295
- 3. Select **Get Many Advanced** as the operation
296
- 4. Build a complex filter, for example:
297
- ```json
298
- {
299
- "filter": [
300
- {
301
- "op": "and",
302
- "items": [
303
- {
304
- "field": "status",
305
- "op": "noteq",
306
- "value": 5
307
- },
308
- {
309
- "op": "or",
310
- "items": [
311
- {
312
- "field": "priority",
313
- "op": "eq",
314
- "value": 6
315
- },
316
- {
317
- "field": "dueDateTime",
318
- "op": "lt",
319
- "value": "{{ $now.plus(3, 'days').toLocal()}}"
320
- }
321
- ]
322
- }
323
- ]
324
- }
325
- ]
326
- }
327
- ```
328
- [Valid filter operators and filter documentation can be found here](https://ww15.autotask.net/help/DeveloperHelp/Content/APIs/REST/API_Calls/REST_Basic_Query_Calls.htm?Highlight=filter#List2)
329
- 5. Choose whether to retrieve all results or limit the number:
330
- - Toggle "Get All" to true to retrieve all matching records
331
- - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
332
- 6. Enable **Select Columns** to choose specific fields to return
333
- 7. Enable **Add Reference Labels** and **Add Picklist Labels** for human-readable values
334
- 8. Execute the workflow to retrieve tickets that are not complete AND either have priority 6 OR are due within the next 3 days
335
-
336
- ### Example: Monitoring API Usage with API Threshold
337
-
338
- 1. Add an **Autotask** node to your workflow
339
- 2. Select **API Threshold** as the resource
340
- 3. The operation **Get API Usage** will be automatically selected (it's the only available operation)
341
- 4. Execute the node to receive current API usage information including:
342
- - Current usage count
343
- - Maximum threshold (limit)
344
- - Usage percentage
345
- - Usage level (Normal, Moderate, High, Critical)
346
- - Remaining requests
347
- - Timeframe duration
348
- 5. You can use this information with IF nodes to implement conditional logic:
349
- - Pause workflows when usage is too high
350
- - Throttle requests during peak usage periods
351
- - Log warnings when approaching limits
352
- - Only execute non-critical operations when usage is below certain thresholds
353
-
354
- ### Advanced Example: Working with Parent-Child Relationships
355
-
356
- Many Autotask entities have parent-child relationships (e.g., Companies and Contacts). To work with these:
357
-
358
- 1. First, retrieve or create the parent entity
359
- 2. Use the parent entity's ID in the child entity operations
360
- 3. For example, to create a Contact for a Company:
361
- - First node: Get or create the Company
362
- - Second node: Create a Contact with the Company ID
363
-
364
- ### Example: Setting Up a Webhook Trigger
365
-
366
- 1. Add an **Autotask Trigger** node to your workflow
367
- 2. Select the entity type to monitor (Companies, Contacts, Tickets, etc.)
368
- 3. Select the events to subscribe to (Create, Update, Delete)
369
- 4. Configure the webhook URL (n8n will handle this automatically)
370
- 5. Optionally specify fields to include in the webhook payload
371
- 6. Optionally exclude specific resources from triggering the workflow
372
- 7. Configure email notifications for webhook delivery failures if needed
373
- 8. Save and activate the workflow
374
- 9. The node will automatically register the webhook with Autotask
375
- 10. When events occur in Autotask, they will trigger your workflow
376
- 11. When the workflow is deactivated, the webhook will be automatically removed
377
-
378
- ## Configuration
379
-
380
- ### Caching Options
381
-
382
- The node includes an enhanced file-based caching system to improve performance by reducing API calls:
383
-
384
- - **Enable Field Caching**: Toggle caching on/off
385
- - **Cache TTL**: How long to cache field values (in seconds)
386
- - **Cache Entity Info**: Whether to cache entity information and field definitions
387
- - **Entity Info TTL**: How long to cache entity information
388
- - **Cache Reference Fields**: Whether to cache reference field values
389
- - **Reference Fields TTL**: How long to cache reference field values
390
- - **Cache Picklists**: Whether to cache picklist values
391
- - **Picklists TTL**: How long to cache picklist values
392
- - **File-based Cache**: Cache is stored in files that can be shared between workflows and runs
393
- - **Cache Directory**: Optional path to a directory where cache files will be stored
394
-
395
- > **IMPORTANT**: This node uses dynamic picklists and field enrichers to convert numerical values into human-readable labels through dynamic lookups. It's strongly recommended to keep caching enabled to avoid excessive API calls. Without caching, each picklist and reference field lookup requires separate API calls, which can quickly consume your API rate limits, especially in workflows with many operations or large data sets.
396
-
397
- ### Label Enrichment and Field Processing
398
-
399
- The node provides options to enrich entities with human-readable labels and simplify field access:
400
-
401
- - **Add Picklist Labels**: Adds "_label" fields for picklist values (e.g., Status_label: "In Progress")
402
- - **Add Reference Labels**: Adds "_label" fields for reference values (e.g., Company_label: "Acme Corporation")
403
- - **Flatten User-Defined Fields**: When enabled, brings UDFs up to the top level of each response object for easier access instead of being nested in the userDefinedFields array (maintains the original array for backward compatibility)
404
-
405
- ### Column Selection
406
-
407
- To improve performance and reduce payload size, you can select specific columns to return:
408
-
409
- - **Select Columns**: Choose which fields to include in the response
410
- - Works with all get operations (get, getMany, getManyAdvanced)
411
- - Compatible with label enrichment features
412
-
413
- ### Timezone Handling
414
-
415
- All dates and times in the Autotask API are in UTC. The node automatically converts between your selected timezone and UTC:
416
-
417
- - When creating or updating records, local times are converted to UTC
418
- - When retrieving records, UTC times are converted to your local timezone
419
- - The timezone is configured in the credentials
420
- - For Search Filter operations, input dates are thoroughly converted to UTC using the configured timezone, ensuring consistency with API requirements
421
- - Output dates from all operations are converted to the configured local timezone for easier workflow handling
422
-
423
- ## Limitations
424
-
425
- ### API Limits
426
-
427
- - Maximum 500 records per page in query results
428
- - Maximum 50 pages per query operation
429
- - Maximum 500 OR conditions in filters
430
- - Maximum 1 User Defined Field per query
431
-
432
- ### Entity-Specific Limitations
433
-
434
- - Some entities may not support all operations (e.g., Project Phases cannot be deleted)
435
- - Parent-child relationships require specific handling
436
- - Some fields may be read-only or have specific validation rules
437
-
438
- ### Performance Considerations
439
-
440
- - Large queries may be slow and should be optimised with filters
441
- - Column selection can significantly improve performance by reducing payload size
442
- - Complex workflows with many API calls may hit rate limits
443
- - Disabling caching when using picklist or reference label enrichment can lead to a high volume of API calls, potentially triggering rate limits. Each field being enriched requires a separate API call when cache is not available.
444
-
445
- ## Troubleshooting
446
-
447
- ### Common Issues
448
-
449
- - **Authentication Errors**: Verify your API credentials and ensure the API user has appropriate permissions
450
- - **Field Validation Errors**: Check field requirements in the Autotask API documentation
451
- - **Rate Limiting**: If you encounter rate limiting, reduce the frequency of API calls or implement retry logic
452
-
453
- ### Reporting Bugs
454
-
455
- If you encounter any bugs or issues with this integration:
456
-
457
- 1. Check the [GitHub Issues](https://github.com/msoukhomlinov/n8n-nodes-autotask/issues) to see if the problem has already been reported
458
- 2. If not, please submit a new issue with:
459
- - A clear description of the problem
460
- - Steps to reproduce the issue
461
- - Expected vs actual behaviour
462
- - Your environment details (n8n version, Node.js version)
463
- - Any relevant error messages or screenshots
464
-
465
- Bug reports should be submitted via GitHub at: https://github.com/msoukhomlinov/n8n-nodes-autotask/issues
466
-
467
- ## Resources
468
-
469
- - [Autotask API Documentation](https://ww6.autotask.net/help/developerhelp/Content/APIs/REST/REST_API_Home.htm)
470
- - [n8n Documentation](https://docs.n8n.io/)
471
- - [GitHub Repository](https://github.com/msoukhomlinov/n8n-nodes-autotask)
472
-
473
- ## Support
474
-
475
- If you find this node helpful and want to support its ongoing development, you can buy me a coffee:
476
-
477
- [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow.svg)](https://buymeacoffee.com/msoukhomlinov)
478
-
479
- Your support helps maintain this project and develop new features.
480
-
481
- ## License
482
-
483
- [MIT](LICENSE)
1
+ # n8n-nodes-autotask
2
+
3
+ ![n8n-nodes-autotask](https://img.shields.io/badge/n8n--nodes--autotask-0.9.3-blue)
4
+ ![License](https://img.shields.io/badge/license-MIT-green)
5
+
6
+ [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow.svg)](https://buymeacoffee.com/msoukhomlinov)
7
+
8
+ > **IMPORTANT**: After updating this node to a new version, a restart of your n8n instance is highly recommended to ensure all changes are properly applied.
9
+
10
+ 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.
11
+
12
+ ![Overview of n8n-nodes-autotask](./overview.gif)
13
+
14
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
15
+
16
+ [Installation](#installation)
17
+ [Authentication](#authentication)
18
+ [Features](#features)
19
+ [Usage](#usage)
20
+ [Configuration](#configuration)
21
+ [Limitations](#limitations)
22
+ [Troubleshooting](#troubleshooting)
23
+ [Resources](#resources)
24
+ [Support](#support)
25
+ [License](#license)
26
+
27
+ ## Installation
28
+
29
+ Follow these steps to install this node:
30
+
31
+ ```bash
32
+ # Install with npm
33
+ npm install n8n-nodes-autotask
34
+
35
+ # Install with pnpm
36
+ pnpm install n8n-nodes-autotask
37
+ ```
38
+
39
+ **Requirements:**
40
+ - n8n version 1.0.0 or later
41
+ - Node.js version 18.10 or later
42
+ - pnpm version 9.1 or later (if using pnpm)
43
+
44
+ ## Authentication
45
+
46
+ To use this node, you need to have API access to your Autotask instance. Follow these steps to set up authentication:
47
+
48
+ 1. In Autotask, go to **Admin > API User Security**
49
+ 2. Create or select an API user
50
+ 3. Note the API Integration Code, Username, and Secret
51
+ 4. In n8n, create a new credential of type **Autotask API**
52
+ 5. Enter your API Integration Code, Username, and Secret
53
+ 6. Select your Autotask zone
54
+ 7. Select your timezone (affects how dates and times are displayed and entered)
55
+ 8. Configure caching options as needed (this will cache dynamically fetched field picklists)
56
+
57
+ ## Features
58
+
59
+ ### Supported Resources
60
+
61
+ The node supports the following Autotask resources:
62
+
63
+ | Resource | Description |
64
+ |----------|-------------|
65
+ | API Threshold | Check Autotask API usage limits and current usage levels |
66
+ | Billing Code | Manage billing codes for time entries and charges |
67
+ | Company | Manage organisations in Autotask |
68
+ | Company Alert | Manage alerts associated with companies |
69
+ | Company Location | Manage locations for companies |
70
+ | Company Note | Manage notes attached to companies |
71
+ | Company Site Configuration | Manage company site configurations and user-defined fields for customer companies |
72
+ | Company Webhook | Manage webhooks for company events |
73
+ | Configuration Item | Manage configuration items (CIs) for companies |
74
+ | Configuration Item Billing Product Association | Manage product associations for configuration items |
75
+ | Configuration Item Category | Manage categories for configuration items |
76
+ | Configuration Item Category UDF Association | Manage UDF associations for CI categories |
77
+ | Configuration Item DNS Record | Manage DNS records for configuration items |
78
+ | Configuration Item Note | Manage notes for configuration items |
79
+ | Configuration Item Related Item | Manage related items for configuration items |
80
+ | Configuration Item SSL Subject Alternative Name | Manage SSL alternative names for configuration items |
81
+ | Configuration Item Type | Manage types for configuration items |
82
+ | Configuration Item Webhook | Manage webhooks for configuration item events |
83
+ | Contact | Manage contacts associated with companies |
84
+ | Contact Groups | Manage contact groups |
85
+ | Contact Group Contacts | Manage contacts within contact groups |
86
+ | Contact Webhook | Manage webhooks for contact events |
87
+ | Contract | Manage contracts for companies |
88
+ | Contract Billing Rules | Manage billing rules for contracts |
89
+ | Contract Block | Manage block hour contracts |
90
+ | Contract Block Hour Factor | Manage hour factors for block hour contracts |
91
+ | Contract Charge | Manage charges associated with contracts |
92
+ | Contract Exclusion Billing Codes | Manage excluded billing codes for contracts |
93
+ | Contract Exclusion Roles | Manage excluded roles for contracts |
94
+ | Contract Exclusion Set Excluded Roles | Manage excluded roles within exclusion sets |
95
+ | Contract Exclusion Set Excluded Work Types | Manage excluded work types within exclusion sets |
96
+ | Contract Exclusion Sets | Manage exclusion sets for contracts |
97
+ | Contract Milestone | Manage milestones for contracts |
98
+ | Contract Note | Manage notes attached to contracts |
99
+ | Contract Rate | Manage rates for contract services |
100
+ | Contract Retainers | Manage retainers for contracts |
101
+ | Contract Role Costs | Manage role costs for contracts |
102
+ | Contract Service | Manage services within contracts |
103
+ | Contract Service Adjustments | Manage adjustments for contract services |
104
+ | Contract Service Bundle Adjustments | Manage adjustments for service bundles |
105
+ | Contract Service Bundles | Manage service bundles within contracts |
106
+ | Contract Service Bundle Units | Manage service bundle units |
107
+ | Contract Service Unit | Manage service units for contracts |
108
+ | Contract Ticket Purchases | Manage ticket purchases for contracts |
109
+ | Countries | Query countries, which are used in address information for companies, contacts, and resources |
110
+ | Domain Registrars | Manage domain registrars |
111
+ | Holiday | Manage holiday dates |
112
+ | Holiday Set | Manage holiday sets for resources |
113
+ | Invoices | Manage invoices |
114
+ | Notification History | View notification history |
115
+ | Opportunity | Manage sales opportunities |
116
+ | Product | Manage products in the catalogue |
117
+ | Product Vendors | Manage vendor associations for products |
118
+ | Project | Manage projects |
119
+ | Project Charge | Manage charges associated with projects |
120
+ | Project Note | Manage notes attached to projects |
121
+ | Project Phase | Manage phases within projects |
122
+ | Project Task | Manage tasks within projects |
123
+ | Quote | Manage quotes for opportunities with pricing for products, services, and labor |
124
+ | Quote Item | Manage line items for quotes including products, services, and labor |
125
+ | Quote Location | Manage shipping and billing address information for quotes |
126
+ | Quote Template | Query quote templates that define content and appearance of quotes |
127
+ | Resource | Manage staff resources |
128
+ | Resource Role | Manage department/role relationships, service desk queues, and service desk roles |
129
+ | Roles | Manage roles in the system |
130
+ | Search Filter | Build advanced search filters |
131
+ | Service | Manage services offered to clients |
132
+ | Service Call | Manage service calls |
133
+ | Service Call Task | Manage tasks associated with service calls |
134
+ | Service Call Task Resource | Manage resources assigned to service call tasks |
135
+ | Service Call Ticket | Manage tickets linked to service calls |
136
+ | Service Call Ticket Resource | Manage resources assigned to service call tickets |
137
+ | Survey | Manage customer surveys |
138
+ | Survey Results | Manage results from customer surveys |
139
+ | Ticket | Manage service tickets |
140
+ | Ticket History | View historical changes to tickets |
141
+ | Ticket Note | Manage notes attached to tickets |
142
+ | Ticket Note Webhook | Manage webhooks for ticket note events |
143
+ | Ticket Webhook | Manage webhooks for ticket events |
144
+ | Time Entry | Manage time entries for billing |
145
+
146
+ ### Operations
147
+
148
+ For most resources, the following operations are available:
149
+
150
+ - **Create**: Add new records
151
+ - **Read**: Retrieve a single record by ID
152
+ - **Update**: Modify existing records
153
+ - **Delete**: Remove records
154
+ - **Get Many**: Retrieve multiple records with basic filtering options. This operation allows you to:
155
+ - Filter records using simple field conditions (equals)
156
+ - Filtering on User Defined Fields (UDFs)
157
+ - Automatically paginate through large result sets
158
+ - Choose to get all results or limit to a specific number (1-500)
159
+ - Set a maximum number of records to return when not retrieving all records
160
+ - Select specific columns to return in the response
161
+ - Add human-readable labels for picklist and reference fields
162
+ - Flatten User-Defined Fields for easier access in workflows
163
+ - **Get Many Advanced**: Build complex queries with multiple filter conditions and logical operators. This operation provides:
164
+ - Support for complex AND/OR logic in filters
165
+ - Nested condition groups for sophisticated queries
166
+ - Filtering on User Defined Fields (UDFs)
167
+ - Advanced operators like contains, beginsWith, endsWith, exists, notExists
168
+ - Support for IN and NOT IN operators with multiple values
169
+ - Choose to get all results or limit to a specific number (1-500)
170
+ - Set a maximum number of records to return when not retrieving all records
171
+ - Select specific columns to return in the response
172
+ - Add human-readable labels for picklist and reference fields
173
+ - Flatten User-Defined Fields for easier access in workflows
174
+ - Date-based filtering with automatic timezone handling
175
+ - **Count**: Get the number of matching records
176
+ - **Get Entity Info**: Retrieve metadata about the entity
177
+ - **Get Field Info**: Retrieve field definitions for the selected entity
178
+
179
+ For webhook resources (Company Webhook, Contact Webhook, Configuration Item Webhook, Ticket Webhook, Ticket Note Webhook), the following operations are available:
180
+ - **Get**: Retrieve a single webhook by ID
181
+ - **Get Many**: Retrieve multiple webhooks with basic filtering
182
+ - **Delete**: Remove a webhook
183
+
184
+ ### Webhook Trigger
185
+
186
+ The node includes an Autotask Trigger node that can receive webhook events from Autotask. The trigger supports:
187
+
188
+ - Events for multiple entity types (Companies, Contacts, Tickets, Configuration Items, Ticket Notes)
189
+ - Create, Update, and Delete events
190
+ - Field selection for webhook payloads (specify which fields to include)
191
+ - Resource exclusion (exclude specific resources from triggering the workflow)
192
+ - Email notifications for webhook delivery failures
193
+ - Threshold notifications for monitoring webhook performance
194
+ - Automatic webhook registration and cleanup
195
+ - Secure payload verification with HMAC signatures
196
+
197
+ ### Advanced Features
198
+
199
+ - **Resource Mapping**: Dynamically map fields based on entity definitions
200
+ - **Advanced Filtering**: Build complex queries with multiple conditions
201
+ - **Column Selection**: Choose specific fields to return in get operations
202
+ - **Picklist Label Enrichment**: Automatically add human-readable labels for picklist fields
203
+ - **Reference Label Enrichment**: Add human-readable labels for reference fields
204
+ - **UDF Flattening**: Bring user-defined fields up to the top level of response objects for easier access
205
+ - **File-based Caching**: Improved performance with persistent caching that can be shared between workflows and runs
206
+ - **Timezone Handling**: Automatic conversion between local time and UTC
207
+ - **API Usage Monitoring**: Check current API usage thresholds and limits using the API Threshold resource to help prevent hitting rate limits and ensure smooth operations
208
+
209
+ ### API Threshold Resource
210
+
211
+ The API Threshold resource provides a simple way to monitor your Autotask API usage limits and current consumption. This helps users:
212
+ - Track how many API requests have been made in the current timeframe
213
+ - See the maximum allowed requests (threshold limit)
214
+ - View the usage as a percentage and categorized level (Normal, Moderate, High, Critical)
215
+ - Calculate remaining available requests
216
+ - Monitor timeframe duration for rate limits
217
+
218
+ This is particularly useful for workflows that make many API calls, allowing you to implement conditional logic based on current usage levels to avoid hitting rate limits and ensure continuous operation.
219
+
220
+ ### AI Tool Integration
221
+
222
+ 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.
223
+
224
+ #### Requirements
225
+
226
+ Currently, n8n only allows core nodes to be used as tools by default. To use this community node as a tool, you need to:
227
+
228
+ 1. Set the environment variable `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE` to `true` when running n8n.
229
+ 2. Add the Autotask node as a tool in your AI agent workflow.
230
+
231
+ #### Environment Variable Configuration
232
+
233
+ For the node to be usable as an AI tool, you must set the following environment variable:
234
+
235
+ ```bash
236
+ N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
237
+ ```
238
+
239
+ This can be done by:
240
+ - Adding it to your .env file
241
+ - Setting it in your system environment variables
242
+ - Including it in your Docker or container configuration
243
+ - Adding it to your startup command (e.g., `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true n8n start`)
244
+
245
+ Without this environment variable set to `true`, n8n will not allow AI agents to use this community node as a tool.
246
+
247
+ #### Example AI Tool Usage
248
+
249
+ An AI agent might use the Autotask node to:
250
+ - Retrieve information about a company or contact
251
+ - Create a new ticket based on user input
252
+ - Update the status of an existing ticket
253
+ - Add notes to a ticket or company record
254
+ - Search for tickets matching specific criteria
255
+
256
+ ## Usage
257
+
258
+ ### Basic Example: Creating a Ticket
259
+
260
+ 1. Add an **Autotask** node to your workflow
261
+ 2. Select **Ticket** as the resource
262
+ 3. Select **Create** as the operation
263
+ 4. Configure the required fields (Title, Status, etc.)
264
+ 5. Connect to a trigger or previous node
265
+ 6. Execute the workflow
266
+
267
+ ### Intermediate Example: Querying Projects with Filters
268
+
269
+ 1. Add an **Autotask** node to your workflow
270
+ 2. Select **Project** as the resource
271
+ 3. Select **Get Many** as the operation
272
+ 4. Add filter conditions (e.g., Status equals "Active")
273
+ 5. Choose whether to retrieve all results or limit the number:
274
+ - Toggle "Get All" to true to retrieve all matching records
275
+ - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
276
+ 6. Connect to a trigger or previous node
277
+ 7. Execute the workflow
278
+
279
+ ### Advanced Example: Using Column Selection and Reference Labels
280
+
281
+ 1. Add an **Autotask** node to your workflow
282
+ 2. Select **Ticket** as the resource
283
+ 3. Select **Get Many** as the operation
284
+ 4. Add filter conditions as needed
285
+ 5. Enable **Select Columns** to choose specific fields to return
286
+ 6. Select only the fields you need in the response (improves performance)
287
+ 7. Enable **Add Picklist Labels** to get human-readable values for picklist fields
288
+ 8. Enable **Add Reference Labels** to get human-readable values for reference fields
289
+ 9. Enable **Flatten User-Defined Fields** to bring UDFs to the top level of response objects
290
+ 10. Execute the workflow to get tickets with only the selected fields and human-readable labels
291
+
292
+ ### Advanced Example: Complex Filtering with Get Many Advanced
293
+
294
+ 1. Add an **Autotask** node to your workflow
295
+ 2. Select **Ticket** as the resource
296
+ 3. Select **Get Many Advanced** as the operation
297
+ 4. Build a complex filter, for example:
298
+ ```json
299
+ {
300
+ "filter": [
301
+ {
302
+ "op": "and",
303
+ "items": [
304
+ {
305
+ "field": "status",
306
+ "op": "noteq",
307
+ "value": 5
308
+ },
309
+ {
310
+ "op": "or",
311
+ "items": [
312
+ {
313
+ "field": "priority",
314
+ "op": "eq",
315
+ "value": 6
316
+ },
317
+ {
318
+ "field": "dueDateTime",
319
+ "op": "lt",
320
+ "value": "{{ $now.plus(3, 'days').toLocal()}}"
321
+ }
322
+ ]
323
+ }
324
+ ]
325
+ }
326
+ ]
327
+ }
328
+ ```
329
+ [Valid filter operators and filter documentation can be found here](https://ww15.autotask.net/help/DeveloperHelp/Content/APIs/REST/API_Calls/REST_Basic_Query_Calls.htm?Highlight=filter#List2)
330
+ 5. Choose whether to retrieve all results or limit the number:
331
+ - Toggle "Get All" to true to retrieve all matching records
332
+ - Toggle "Get All" to false and set "Max Records" (1-500) to limit the results
333
+ 6. Enable **Select Columns** to choose specific fields to return
334
+ 7. Enable **Add Reference Labels** and **Add Picklist Labels** for human-readable values
335
+ 8. Execute the workflow to retrieve tickets that are not complete AND either have priority 6 OR are due within the next 3 days
336
+
337
+ ### Example: Monitoring API Usage with API Threshold
338
+
339
+ 1. Add an **Autotask** node to your workflow
340
+ 2. Select **API Threshold** as the resource
341
+ 3. The operation **Get API Usage** will be automatically selected (it's the only available operation)
342
+ 4. Execute the node to receive current API usage information including:
343
+ - Current usage count
344
+ - Maximum threshold (limit)
345
+ - Usage percentage
346
+ - Usage level (Normal, Moderate, High, Critical)
347
+ - Remaining requests
348
+ - Timeframe duration
349
+ 5. You can use this information with IF nodes to implement conditional logic:
350
+ - Pause workflows when usage is too high
351
+ - Throttle requests during peak usage periods
352
+ - Log warnings when approaching limits
353
+ - Only execute non-critical operations when usage is below certain thresholds
354
+
355
+ ### Advanced Example: Working with Parent-Child Relationships
356
+
357
+ Many Autotask entities have parent-child relationships (e.g., Companies and Contacts). To work with these:
358
+
359
+ 1. First, retrieve or create the parent entity
360
+ 2. Use the parent entity's ID in the child entity operations
361
+ 3. For example, to create a Contact for a Company:
362
+ - First node: Get or create the Company
363
+ - Second node: Create a Contact with the Company ID
364
+
365
+ ### Example: Setting Up a Webhook Trigger
366
+
367
+ 1. Add an **Autotask Trigger** node to your workflow
368
+ 2. Select the entity type to monitor (Companies, Contacts, Tickets, etc.)
369
+ 3. Select the events to subscribe to (Create, Update, Delete)
370
+ 4. Configure the webhook URL (n8n will handle this automatically)
371
+ 5. Optionally specify fields to include in the webhook payload
372
+ 6. Optionally exclude specific resources from triggering the workflow
373
+ 7. Configure email notifications for webhook delivery failures if needed
374
+ 8. Save and activate the workflow
375
+ 9. The node will automatically register the webhook with Autotask
376
+ 10. When events occur in Autotask, they will trigger your workflow
377
+ 11. When the workflow is deactivated, the webhook will be automatically removed
378
+
379
+ ## Configuration
380
+
381
+ ### Caching Options
382
+
383
+ The node includes an enhanced file-based caching system to improve performance by reducing API calls:
384
+
385
+ - **Enable Field Caching**: Toggle caching on/off
386
+ - **Cache TTL**: How long to cache field values (in seconds)
387
+ - **Cache Entity Info**: Whether to cache entity information and field definitions
388
+ - **Entity Info TTL**: How long to cache entity information
389
+ - **Cache Reference Fields**: Whether to cache reference field values
390
+ - **Reference Fields TTL**: How long to cache reference field values
391
+ - **Cache Picklists**: Whether to cache picklist values
392
+ - **Picklists TTL**: How long to cache picklist values
393
+ - **File-based Cache**: Cache is stored in files that can be shared between workflows and runs
394
+ - **Cache Directory**: Optional path to a directory where cache files will be stored
395
+
396
+ > **IMPORTANT**: This node uses dynamic picklists and field enrichers to convert numerical values into human-readable labels through dynamic lookups. It's strongly recommended to keep caching enabled to avoid excessive API calls. Without caching, each picklist and reference field lookup requires separate API calls, which can quickly consume your API rate limits, especially in workflows with many operations or large data sets.
397
+
398
+ ### Label Enrichment and Field Processing
399
+
400
+ The node provides options to enrich entities with human-readable labels and simplify field access:
401
+
402
+ - **Add Picklist Labels**: Adds "_label" fields for picklist values (e.g., Status_label: "In Progress")
403
+ - **Add Reference Labels**: Adds "_label" fields for reference values (e.g., Company_label: "Acme Corporation")
404
+ - **Flatten User-Defined Fields**: When enabled, brings UDFs up to the top level of each response object for easier access instead of being nested in the userDefinedFields array (maintains the original array for backward compatibility)
405
+
406
+ ### Column Selection
407
+
408
+ To improve performance and reduce payload size, you can select specific columns to return:
409
+
410
+ - **Select Columns**: Choose which fields to include in the response
411
+ - Works with all get operations (get, getMany, getManyAdvanced)
412
+ - Compatible with label enrichment features
413
+
414
+ ### Timezone Handling
415
+
416
+ All dates and times in the Autotask API are in UTC. The node automatically converts between your selected timezone and UTC:
417
+
418
+ - When creating or updating records, local times are converted to UTC
419
+ - When retrieving records, UTC times are converted to your local timezone
420
+ - The timezone is configured in the credentials
421
+ - For Search Filter operations, input dates are thoroughly converted to UTC using the configured timezone, ensuring consistency with API requirements
422
+ - Output dates from all operations are converted to the configured local timezone for easier workflow handling
423
+
424
+ ## Limitations
425
+
426
+ ### API Limits
427
+
428
+ - Maximum 500 records per page in query results
429
+ - Maximum 50 pages per query operation
430
+ - Maximum 500 OR conditions in filters
431
+ - Maximum 1 User Defined Field per query
432
+
433
+ ### Entity-Specific Limitations
434
+
435
+ - Some entities may not support all operations (e.g., Project Phases cannot be deleted)
436
+ - Parent-child relationships require specific handling
437
+ - Some fields may be read-only or have specific validation rules
438
+
439
+ ### Performance Considerations
440
+
441
+ - Large queries may be slow and should be optimised with filters
442
+ - Column selection can significantly improve performance by reducing payload size
443
+ - Complex workflows with many API calls may hit rate limits
444
+ - Disabling caching when using picklist or reference label enrichment can lead to a high volume of API calls, potentially triggering rate limits. Each field being enriched requires a separate API call when cache is not available.
445
+
446
+ ## Troubleshooting
447
+
448
+ ### Common Issues
449
+
450
+ - **Authentication Errors**: Verify your API credentials and ensure the API user has appropriate permissions
451
+ - **Field Validation Errors**: Check field requirements in the Autotask API documentation
452
+ - **Rate Limiting**: If you encounter rate limiting, reduce the frequency of API calls or implement retry logic
453
+
454
+ ### Reporting Bugs
455
+
456
+ If you encounter any bugs or issues with this integration:
457
+
458
+ 1. Check the [GitHub Issues](https://github.com/msoukhomlinov/n8n-nodes-autotask/issues) to see if the problem has already been reported
459
+ 2. If not, please submit a new issue with:
460
+ - A clear description of the problem
461
+ - Steps to reproduce the issue
462
+ - Expected vs actual behaviour
463
+ - Your environment details (n8n version, Node.js version)
464
+ - Any relevant error messages or screenshots
465
+
466
+ Bug reports should be submitted via GitHub at: https://github.com/msoukhomlinov/n8n-nodes-autotask/issues
467
+
468
+ ## Resources
469
+
470
+ - [Autotask API Documentation](https://ww6.autotask.net/help/developerhelp/Content/APIs/REST/REST_API_Home.htm)
471
+ - [n8n Documentation](https://docs.n8n.io/)
472
+ - [GitHub Repository](https://github.com/msoukhomlinov/n8n-nodes-autotask)
473
+
474
+ ## Support
475
+
476
+ If you find this node helpful and want to support its ongoing development, you can buy me a coffee:
477
+
478
+ [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow.svg)](https://buymeacoffee.com/msoukhomlinov)
479
+
480
+ Your support helps maintain this project and develop new features.
481
+
482
+ ## License
483
+
484
+ [MIT](LICENSE)