@lotics/cli 0.292.3 → 0.294.0

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.
@@ -0,0 +1,3694 @@
1
+ <!-- Generated by backend/scripts/generate_workflow_steps_doc.ts from each step's schemas — never edit by hand. -->
2
+
3
+ # Workflow steps
4
+
5
+ The steps only a workflow body runs: a connection's (an invoice issuer, a mailbox, …) and the platform's own. Each is
6
+ called as `await <step>({ ...inputs })` (see `workflows`); every other tool's inputs and answer are printed by
7
+ `lotics tools <name>`.
8
+
9
+ **How a step fails.** A step that is refused — an input the schema rejects, a connection the workspace lacks, an
10
+ answer the provider refuses — ends the run, and the run's error reads `[<step>] <reason>`. Inside `try { … } catch
11
+ (e) { … }` the body handles it instead: `e` is `{ message, type, step_id?, detail? }`, `message` the reason as
12
+ above. A provider's refusal carries the provider's own words.
13
+
14
+ ## bkav
15
+
16
+ ### bkav_attach_files (workflow step)
17
+
18
+ - Attach workspace files (a biên bản, a bảng kê) to an invoice on Bkav.
19
+ - Bkav accepts PDF and Excel, at most 1 MB each.
20
+
21
+ **Inputs**
22
+
23
+ | Name | Type | Required | What it is |
24
+ | --- | --- | --- | --- |
25
+ | `connected_account_id` | string | yes | Bkav connected account |
26
+ | `invoice_guid` | string | | |
27
+ | `partner_invoice_id` | string | | Your PartnerInvoiceStringID, when invoice_guid is not set |
28
+ | `file_ids` | string[] | yes | |
29
+
30
+ **Answer**
31
+
32
+ | Name | Type | Required | What it is |
33
+ | --- | --- | --- | --- |
34
+ | `results` | object[] | yes | |
35
+ | `results[].PartnerInvoiceID` | number | yes | |
36
+ | `results[].PartnerInvoiceStringID` | string \\| null | yes | Null on a delete's answer |
37
+ | `results[].InvoiceGUID` | string | yes | |
38
+ | `results[].InvoiceForm` | string \\| null | yes | Null on a draft's link answer |
39
+ | `results[].InvoiceSerial` | string \\| null | yes | Null on a draft's link answer |
40
+ | `results[].InvoiceNo` | number | yes | Assigned by a numbered kind; 0 on a draft |
41
+ | `results[].MTC` | string \\| null | yes | Mã tra cứu the buyer looks the invoice up with; null on a draft's link answer |
42
+ | `results[].MaCuaCQT` | string \\| null | | |
43
+ | `results[].Status` | number | yes | 0 succeeded; otherwise MessLog says why |
44
+ | `results[].MessLog` | string | yes | |
45
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
46
+
47
+ ### bkav_cancel_invoices (workflow step)
48
+
49
+ - Cancel issued invoices.
50
+ - A cancelled invoice still reports to the tax authority; correcting one instead is a replacement or adjustment through bkav_submit_invoices. (workflow step)
51
+
52
+ **Inputs**
53
+
54
+ | Name | Type | Required | What it is |
55
+ | --- | --- | --- | --- |
56
+ | `connected_account_id` | string | yes | Bkav connected account |
57
+ | `invoice_guids` | string[] | | InvoiceGUIDs Bkav returned |
58
+ | `partner_invoice_ids` | string[] | | Your PartnerInvoiceStringIDs |
59
+ | `reason` | string | yes | |
60
+
61
+ **Answer**
62
+
63
+ | Name | Type | Required | What it is |
64
+ | --- | --- | --- | --- |
65
+ | `results` | object[] | yes | |
66
+ | `results[].PartnerInvoiceID` | number | yes | |
67
+ | `results[].PartnerInvoiceStringID` | string \\| null | yes | Null on a delete's answer |
68
+ | `results[].InvoiceGUID` | string | yes | |
69
+ | `results[].InvoiceForm` | string \\| null | yes | Null on a draft's link answer |
70
+ | `results[].InvoiceSerial` | string \\| null | yes | Null on a draft's link answer |
71
+ | `results[].InvoiceNo` | number | yes | Assigned by a numbered kind; 0 on a draft |
72
+ | `results[].MTC` | string \\| null | yes | Mã tra cứu the buyer looks the invoice up with; null on a draft's link answer |
73
+ | `results[].MaCuaCQT` | string \\| null | | |
74
+ | `results[].Status` | number | yes | 0 succeeded; otherwise MessLog says why |
75
+ | `results[].MessLog` | string | yes | |
76
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
77
+
78
+ ### bkav_create_bill (workflow step)
79
+
80
+ - Record a cash-register bill on Bkav.
81
+ - Field names are Bkav's.
82
+
83
+ **Inputs**
84
+
85
+ | Name | Type | Required | What it is |
86
+ | --- | --- | --- | --- |
87
+ | `connected_account_id` | string | yes | Bkav connected account |
88
+ | `bill` | object | yes | |
89
+ | `bill.Bill` | object | yes | |
90
+ | `bill.Bill.BillCode` | number | yes | |
91
+ | `bill.Bill.OriginalBillCode` | number | | |
92
+ | `bill.Bill.BillDate` | string | yes | |
93
+ | `bill.Bill.BillStatusID` | number | yes | |
94
+ | `bill.Bill.PayMethod` | string | | |
95
+ | `bill.Bill.Note` | string | | |
96
+ | `bill.ListBillDetails` | object[] | yes | |
97
+ | `bill.ListBillDetails[].ItemTypeID` | number | | 0 goods, 4 description line, 15 promotional goods, … |
98
+ | `bill.ListBillDetails[].IsDiscount` | boolean | | |
99
+ | `bill.ListBillDetails[].ItemCode` | string | | |
100
+ | `bill.ListBillDetails[].ItemName` | string | yes | |
101
+ | `bill.ListBillDetails[].UnitName` | string | | |
102
+ | `bill.ListBillDetails[].Qty` | number | | |
103
+ | `bill.ListBillDetails[].Price` | number | | |
104
+ | `bill.ListBillDetails[].Amount` | number | | |
105
+ | `bill.ListBillDetails[].TaxRateID` | number | | 1 0%, 2 5%, 3 10%, 4 không chịu thuế, 9 8%, … |
106
+ | `bill.ListBillDetails[].TaxRate` | number | | |
107
+ | `bill.ListBillDetails[].TaxAmount` | number | | |
108
+ | `bill.ListBillDetails[].OtherAmount` | number | | |
109
+ | `bill.ListBillDetails[].DiscountRate` | number | | |
110
+ | `bill.ListBillDetails[].DiscountAmount` | number | | |
111
+ | `bill.ListBillDetails[].UserDefineDetails` | string | | |
112
+ | `bill.ListBillDetails[].IsIncrease` | boolean \\| null | | On an adjustment: true raises the amount, false lowers it, absent adjusts information |
113
+ | `bill.ListBillDetails[].SpecialtyItems` | string | | |
114
+
115
+ **Answer**
116
+
117
+ | Name | Type | Required | What it is |
118
+ | --- | --- | --- | --- |
119
+ | `created` | true | yes | |
120
+
121
+ ### bkav_create_invoice_from_bills (workflow step)
122
+
123
+ - Raise one invoice from cash-register bills, by their BillGUIDs.
124
+ - Field names are Bkav's.
125
+
126
+ **Inputs**
127
+
128
+ | Name | Type | Required | What it is |
129
+ | --- | --- | --- | --- |
130
+ | `connected_account_id` | string | yes | Bkav connected account |
131
+ | `input` | object | yes | |
132
+ | `input.Invoice` | object | yes | |
133
+ | `input.Invoice.InvoiceTypeID` | number | yes | 1 GTGT, 2 bán hàng, 5 PXK kiêm VCNB, 6 PXK gửi bán đại lý |
134
+ | `input.Invoice.InvoiceDate` | string | yes | ISO date |
135
+ | `input.Invoice.BuyerCode` | string | | |
136
+ | `input.Invoice.BuyerName` | string | | |
137
+ | `input.Invoice.BuyerTaxCode` | string | | |
138
+ | `input.Invoice.BuyerUnitName` | string | | |
139
+ | `input.Invoice.BuyerAddress` | string | | |
140
+ | `input.Invoice.BuyerBankAccount` | string | | Sent empty when absent: Bkav refuses it missing |
141
+ | `input.Invoice.PayMethodID` | number | | 1 TM, 2 CK, 3 TM/CK, … |
142
+ | `input.Invoice.ReceiveTypeID` | number | | 1 email, 2 SMS, 3 both, 4 courier |
143
+ | `input.Invoice.ReceiverEmail` | string | | |
144
+ | `input.Invoice.ReceiverMobile` | string | | |
145
+ | `input.Invoice.ReceiverAddress` | string | | Sent empty when absent: Bkav refuses it missing |
146
+ | `input.Invoice.ReceiverName` | string | | Sent empty when absent: Bkav refuses it missing |
147
+ | `input.Invoice.Note` | string | | |
148
+ | `input.Invoice.BillCode` | string | | Sent empty when absent: Bkav refuses it missing |
149
+ | `input.Invoice.CurrencyID` | string | | |
150
+ | `input.Invoice.ExchangeRate` | number | | |
151
+ | `input.Invoice.InvoiceForm` | string | | Mẫu số |
152
+ | `input.Invoice.InvoiceSerial` | string | | Ký hiệu |
153
+ | `input.Invoice.InvoiceNo` | number | | Số; 0 when Bkav assigns it |
154
+ | `input.Invoice.MaCuaCQT` | string | | Set only by a cash-register flow that already holds the authority's code |
155
+ | `input.Invoice.UserDefine` | string | | JSON-encoded template fields agreed with Bkav |
156
+ | `input.Invoice.UIDefine` | string | | JSON-encoded delivery-note fields (InvoiceTypeID 5 and 6) |
157
+ | `input.Invoice.isBTH` | boolean | | |
158
+ | `input.Invoice.CCCD` | string | | |
159
+ | `input.Invoice.PassportNumber` | string | | |
160
+ | `input.Invoice.FiscalCodes` | string | | |
161
+ | `input.Invoice.Reason` | string | | Why — required on a replacement or adjustment |
162
+ | `input.Invoice.OriginalInvoiceIdentify` | string | | `[mẫu số]_[ký hiệu]_[số]` of the invoice a replacement or adjustment corrects |
163
+ | `input.Invoice.InvoiceGUID` | string | | Addresses the invoice for an update by guid |
164
+ | `input.BillGUIDs` | string[] | yes | |
165
+
166
+ **Answer**
167
+
168
+ | Name | Type | Required | What it is |
169
+ | --- | --- | --- | --- |
170
+ | `results` | object[] | yes | |
171
+ | `results[].PartnerInvoiceID` | number | yes | |
172
+ | `results[].PartnerInvoiceStringID` | string \\| null | yes | Null on a delete's answer |
173
+ | `results[].InvoiceGUID` | string | yes | |
174
+ | `results[].InvoiceForm` | string \\| null | yes | Null on a draft's link answer |
175
+ | `results[].InvoiceSerial` | string \\| null | yes | Null on a draft's link answer |
176
+ | `results[].InvoiceNo` | number | yes | Assigned by a numbered kind; 0 on a draft |
177
+ | `results[].MTC` | string \\| null | yes | Mã tra cứu the buyer looks the invoice up with; null on a draft's link answer |
178
+ | `results[].MaCuaCQT` | string \\| null | | |
179
+ | `results[].Status` | number | yes | 0 succeeded; otherwise MessLog says why |
180
+ | `results[].MessLog` | string | yes | |
181
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
182
+
183
+ ### bkav_delete_invoices (workflow step)
184
+
185
+ - Delete invoices that were never issued.
186
+ - A numbered one can be deleted only if its number is the highest in its range.
187
+
188
+ **Inputs**
189
+
190
+ | Name | Type | Required | What it is |
191
+ | --- | --- | --- | --- |
192
+ | `connected_account_id` | string | yes | Bkav connected account |
193
+ | `invoice_guids` | string[] | | InvoiceGUIDs Bkav returned |
194
+ | `partner_invoice_ids` | string[] | | Your PartnerInvoiceStringIDs |
195
+ | `reason` | string | | |
196
+
197
+ **Answer**
198
+
199
+ | Name | Type | Required | What it is |
200
+ | --- | --- | --- | --- |
201
+ | `results` | object[] | yes | |
202
+ | `results[].PartnerInvoiceID` | number | yes | |
203
+ | `results[].PartnerInvoiceStringID` | string \\| null | yes | Null on a delete's answer |
204
+ | `results[].InvoiceGUID` | string | yes | |
205
+ | `results[].InvoiceForm` | string \\| null | yes | Null on a draft's link answer |
206
+ | `results[].InvoiceSerial` | string \\| null | yes | Null on a draft's link answer |
207
+ | `results[].InvoiceNo` | number | yes | Assigned by a numbered kind; 0 on a draft |
208
+ | `results[].MTC` | string \\| null | yes | Mã tra cứu the buyer looks the invoice up with; null on a draft's link answer |
209
+ | `results[].MaCuaCQT` | string \\| null | | |
210
+ | `results[].Status` | number | yes | 0 succeeded; otherwise MessLog says why |
211
+ | `results[].MessLog` | string | yes | |
212
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
213
+
214
+ ### bkav_explain_invoice_error (workflow step)
215
+
216
+ - Explain an erroneous invoice to the tax authority without replacing or adjusting it, optionally answering one of its notices.
217
+
218
+ **Inputs**
219
+
220
+ | Name | Type | Required | What it is |
221
+ | --- | --- | --- | --- |
222
+ | `connected_account_id` | string | yes | Bkav connected account |
223
+ | `invoice_guid` | string | yes | |
224
+ | `reason` | string | yes | |
225
+ | `notice_number` | string | | Số of the authority's notice being answered |
226
+ | `notice_date` | string | | yyyy-mm-dd; with notice_number |
227
+
228
+ **Answer**
229
+
230
+ | Name | Type | Required | What it is |
231
+ | --- | --- | --- | --- |
232
+ | `results` | object[] | yes | |
233
+ | `results[].InvoiceGUID` | string | yes | |
234
+ | `results[].Status` | number | yes | 0 succeeded; otherwise Msg says why |
235
+ | `results[].Msg` | string | yes | |
236
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
237
+
238
+ ### bkav_explain_replaced_invoice (workflow step)
239
+
240
+ - Explain to the tax authority an invoice that was replaced or adjusted.
241
+
242
+ **Inputs**
243
+
244
+ | Name | Type | Required | What it is |
245
+ | --- | --- | --- | --- |
246
+ | `connected_account_id` | string | yes | Bkav connected account |
247
+ | `invoice_guid` | string | yes | |
248
+ | `reason` | string | yes | |
249
+
250
+ **Answer**
251
+
252
+ | Name | Type | Required | What it is |
253
+ | --- | --- | --- | --- |
254
+ | `results` | object[] | yes | |
255
+ | `results[].InvoiceGUID` | string | yes | |
256
+ | `results[].Status` | number | yes | 0 succeeded; otherwise Msg says why |
257
+ | `results[].Msg` | string | yes | |
258
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
259
+
260
+ ### bkav_get_bill (workflow step)
261
+
262
+ - Read a cash-register bill.
263
+
264
+ **Inputs**
265
+
266
+ | Name | Type | Required | What it is |
267
+ | --- | --- | --- | --- |
268
+ | `connected_account_id` | string | yes | Bkav connected account |
269
+ | `seller_tax_code` | string | yes | |
270
+ | `organization_code` | string | yes | |
271
+ | `bill_code` | number | yes | |
272
+
273
+ **Answer**
274
+
275
+ | Name | Type | Required | What it is |
276
+ | --- | --- | --- | --- |
277
+ | `bill` | object | yes | |
278
+
279
+ ### bkav_get_error_notice_pdf (workflow step)
280
+
281
+ - Save the PDF of an invoice's 04/SS error notice as a workspace file.
282
+
283
+ **Inputs**
284
+
285
+ | Name | Type | Required | What it is |
286
+ | --- | --- | --- | --- |
287
+ | `connected_account_id` | string | yes | Bkav connected account |
288
+ | `partner_invoice_id` | string | yes | Your PartnerInvoiceStringID |
289
+
290
+ **Answer**
291
+
292
+ | Name | Type | Required | What it is |
293
+ | --- | --- | --- | --- |
294
+ | `file_id` | string | yes | The ID of the generated file. |
295
+ | `url` | string | yes | The download URL of the generated file. |
296
+ | `filename` | string | yes | The filename of the generated file, including extension. |
297
+ | `mime_type` | string | yes | The MIME type of the generated file. |
298
+
299
+ ### bkav_get_file_by_lookup_code (workflow step)
300
+
301
+ - Save an invoice's display copy, conversion copy or XML as a workspace file, found by the mã tra cứu the buyer was sent.
302
+
303
+ **Inputs**
304
+
305
+ | Name | Type | Required | What it is |
306
+ | --- | --- | --- | --- |
307
+ | `connected_account_id` | string | yes | Bkav connected account |
308
+ | `lookup_code` | string | yes | Mã tra cứu |
309
+ | `kind` | "display" \\| "converted" \\| "xml" | yes | |
310
+
311
+ **Answer**
312
+
313
+ | Name | Type | Required | What it is |
314
+ | --- | --- | --- | --- |
315
+ | `file_id` | string | yes | The ID of the generated file. |
316
+ | `url` | string | yes | The download URL of the generated file. |
317
+ | `filename` | string | yes | The filename of the generated file, including extension. |
318
+ | `mime_type` | string | yes | The MIME type of the generated file. |
319
+
320
+ ### bkav_get_invoice (workflow step)
321
+
322
+ - Read one invoice as Bkav holds it — header, lines, status and mã tra cứu.
323
+
324
+ **Inputs**
325
+
326
+ | Name | Type | Required | What it is |
327
+ | --- | --- | --- | --- |
328
+ | `connected_account_id` | string | yes | Bkav connected account |
329
+ | `id` | string | yes | Your PartnerInvoiceStringID or Bkav's InvoiceGUID |
330
+
331
+ **Answer**
332
+
333
+ | Name | Type | Required | What it is |
334
+ | --- | --- | --- | --- |
335
+ | `invoice` | object | yes | |
336
+
337
+ ### bkav_get_invoice_file (workflow step)
338
+
339
+ - Save an invoice's PDF or signed XML as a workspace file.
340
+
341
+ **Inputs**
342
+
343
+ | Name | Type | Required | What it is |
344
+ | --- | --- | --- | --- |
345
+ | `connected_account_id` | string | yes | Bkav connected account |
346
+ | `partner_invoice_id` | string | yes | Your PartnerInvoiceStringID |
347
+ | `format` | "pdf" \\| "xml" | yes | |
348
+
349
+ **Answer**
350
+
351
+ | Name | Type | Required | What it is |
352
+ | --- | --- | --- | --- |
353
+ | `file_id` | string | yes | The ID of the generated file. |
354
+ | `url` | string | yes | The download URL of the generated file. |
355
+ | `filename` | string | yes | The filename of the generated file, including extension. |
356
+ | `mime_type` | string | yes | The MIME type of the generated file. |
357
+
358
+ ### bkav_get_invoice_history (workflow step)
359
+
360
+ - Read everything that happened to an invoice on Bkav, oldest first.
361
+
362
+ **Inputs**
363
+
364
+ | Name | Type | Required | What it is |
365
+ | --- | --- | --- | --- |
366
+ | `connected_account_id` | string | yes | Bkav connected account |
367
+ | `invoice_guid` | string | yes | |
368
+
369
+ **Answer**
370
+
371
+ | Name | Type | Required | What it is |
372
+ | --- | --- | --- | --- |
373
+ | `entries` | object[] | yes | |
374
+
375
+ ### bkav_get_invoice_link (workflow step)
376
+
377
+ - Get a download link for an invoice's display copy, conversion copy, or its 04/SS error notice.
378
+
379
+ **Inputs**
380
+
381
+ | Name | Type | Required | What it is |
382
+ | --- | --- | --- | --- |
383
+ | `connected_account_id` | string | yes | Bkav connected account |
384
+ | `partner_invoice_id` | string | yes | Your PartnerInvoiceStringID |
385
+ | `kind` | "display" \\| "converted" \\| "notice_04ss" | yes | |
386
+
387
+ **Answer**
388
+
389
+ | Name | Type | Required | What it is |
390
+ | --- | --- | --- | --- |
391
+ | `url` | string | yes | |
392
+
393
+ ### bkav_get_invoice_status (workflow step)
394
+
395
+ - Read an invoice's status on Bkav.
396
+
397
+ **Inputs**
398
+
399
+ | Name | Type | Required | What it is |
400
+ | --- | --- | --- | --- |
401
+ | `connected_account_id` | string | yes | Bkav connected account |
402
+ | `invoice_guid` | string | yes | |
403
+
404
+ **Answer**
405
+
406
+ | Name | Type | Required | What it is |
407
+ | --- | --- | --- | --- |
408
+ | `invoice_status_id` | number | yes | 1 mới tạo, 2 đã phát hành, 3 đã huỷ, 5–8 chờ/đã thay thế–điều chỉnh, 11 đã cấp số chờ ký |
409
+
410
+ ### bkav_get_listing (workflow step)
411
+
412
+ - Save the bảng kê of one invoice type over a window as a workspace spreadsheet.
413
+
414
+ **Inputs**
415
+
416
+ | Name | Type | Required | What it is |
417
+ | --- | --- | --- | --- |
418
+ | `connected_account_id` | string | yes | Bkav connected account |
419
+ | `invoice_type_id` | number | yes | 1 GTGT, 2 bán hàng, … |
420
+ | `from_date` | string | yes | yyyy-mm-dd |
421
+ | `to_date` | string | yes | yyyy-mm-dd |
422
+
423
+ **Answer**
424
+
425
+ | Name | Type | Required | What it is |
426
+ | --- | --- | --- | --- |
427
+ | `file_id` | string | yes | The ID of the generated file. |
428
+ | `url` | string | yes | The download URL of the generated file. |
429
+ | `filename` | string | yes | The filename of the generated file, including extension. |
430
+ | `mime_type` | string | yes | The MIME type of the generated file. |
431
+
432
+ ### bkav_get_report_bc26 (workflow step)
433
+
434
+ - Save the BC26/AC invoice usage report for a window as a workspace XML file.
435
+
436
+ **Inputs**
437
+
438
+ | Name | Type | Required | What it is |
439
+ | --- | --- | --- | --- |
440
+ | `connected_account_id` | string | yes | Bkav connected account |
441
+ | `from_date` | string | yes | yyyy-mm-dd |
442
+ | `to_date` | string | yes | yyyy-mm-dd |
443
+
444
+ **Answer**
445
+
446
+ | Name | Type | Required | What it is |
447
+ | --- | --- | --- | --- |
448
+ | `file_id` | string | yes | The ID of the generated file. |
449
+ | `url` | string | yes | The download URL of the generated file. |
450
+ | `filename` | string | yes | The filename of the generated file, including extension. |
451
+ | `mime_type` | string | yes | The MIME type of the generated file. |
452
+
453
+ ### bkav_get_tax_status (workflow step)
454
+
455
+ - Read the tax authority's status for an invoice and its mã của CQT once granted.
456
+
457
+ **Inputs**
458
+
459
+ | Name | Type | Required | What it is |
460
+ | --- | --- | --- | --- |
461
+ | `connected_account_id` | string | yes | Bkav connected account |
462
+ | `invoice_guid` | string | yes | |
463
+
464
+ **Answer**
465
+
466
+ | Name | Type | Required | What it is |
467
+ | --- | --- | --- | --- |
468
+ | `statuses` | object[] | yes | |
469
+ | `statuses[].BkavStatus` | number | yes | InvoiceStatusID: 1 mới tạo, 2 đã phát hành, 3 đã huỷ, … |
470
+ | `statuses[].TaxStatus` | number | yes | 32 waiting, 33 accepted, 34–39 returned or failed |
471
+ | `statuses[].TaxAuthorityCode` | string \\| null | yes | Mã của Cơ quan thuế, once granted |
472
+ | `statuses[].ErrorContent` | string \\| null | yes | |
473
+
474
+ ### bkav_list_invoices_by_date (workflow step)
475
+
476
+ - List invoices dated within a window, one page at a time.
477
+
478
+ **Inputs**
479
+
480
+ | Name | Type | Required | What it is |
481
+ | --- | --- | --- | --- |
482
+ | `connected_account_id` | string | yes | Bkav connected account |
483
+ | `from_date` | string | yes | yyyy-mm-dd |
484
+ | `to_date` | string | yes | yyyy-mm-dd |
485
+ | `page` | number | | 1-based |
486
+
487
+ **Answer**
488
+
489
+ | Name | Type | Required | What it is |
490
+ | --- | --- | --- | --- |
491
+ | `invoices` | object[] | yes | |
492
+
493
+ ### bkav_list_invoices_by_number (workflow step)
494
+
495
+ - List invoices of one mẫu số and ký hiệu by number range.
496
+
497
+ **Inputs**
498
+
499
+ | Name | Type | Required | What it is |
500
+ | --- | --- | --- | --- |
501
+ | `connected_account_id` | string | yes | Bkav connected account |
502
+ | `form` | string | yes | Mẫu số |
503
+ | `serial` | string | yes | Ký hiệu |
504
+ | `from_number` | number | yes | |
505
+ | `to_number` | number | yes | |
506
+
507
+ **Answer**
508
+
509
+ | Name | Type | Required | What it is |
510
+ | --- | --- | --- | --- |
511
+ | `invoices` | object[] | yes | |
512
+
513
+ ### bkav_lookup_company (workflow step)
514
+
515
+ - Look up a company in the tax registry by Mã số thuế, through the Bkav account.
516
+
517
+ **Inputs**
518
+
519
+ | Name | Type | Required | What it is |
520
+ | --- | --- | --- | --- |
521
+ | `connected_account_id` | string | yes | Bkav connected account |
522
+ | `tax_code` | string | yes | |
523
+
524
+ **Answer**
525
+
526
+ | Name | Type | Required | What it is |
527
+ | --- | --- | --- | --- |
528
+ | `company` | object | yes | |
529
+ | `company.MaSoThue` | string | yes | |
530
+ | `company.TenChinhThuc` | string | yes | |
531
+ | `company.DiaChiGiaoDichChinh` | string | yes | |
532
+ | `company.DiaChiGiaoDichPhu` | string | yes | |
533
+ | `company.TrangThaiHoatDong` | string | yes | |
534
+ | `company.ChuDoanhNghiep` | string | | |
535
+ | `company.SoDienThoai` | string \\| null | | |
536
+ | `company.LastUpdate` | string | | |
537
+
538
+ ### bkav_send_lookup_email (workflow step)
539
+
540
+ - Send an invoice's lookup email to the buyer again, or to another email or phone.
541
+
542
+ **Inputs**
543
+
544
+ | Name | Type | Required | What it is |
545
+ | --- | --- | --- | --- |
546
+ | `connected_account_id` | string | yes | Bkav connected account |
547
+ | `invoice_guid` | string | yes | |
548
+ | `email` | string | | |
549
+ | `mobile` | string | | |
550
+
551
+ **Answer**
552
+
553
+ | Name | Type | Required | What it is |
554
+ | --- | --- | --- | --- |
555
+ | `sent` | true | yes | |
556
+
557
+ ### bkav_sign_invoices (workflow step)
558
+
559
+ - Sign — issue — invoices with the account's HSM signature, making them tax-registered documents.
560
+ - An account that signs with a USB token cannot sign this way.
561
+
562
+ **Inputs**
563
+
564
+ | Name | Type | Required | What it is |
565
+ | --- | --- | --- | --- |
566
+ | `connected_account_id` | string | yes | Bkav connected account |
567
+ | `invoice_guids` | string[] | yes | |
568
+
569
+ **Answer**
570
+
571
+ | Name | Type | Required | What it is |
572
+ | --- | --- | --- | --- |
573
+ | `signed` | string[] | yes | |
574
+
575
+ ### bkav_submit_invoices (workflow step)
576
+
577
+ - Create, replace or adjust invoices on Bkav, in Bkav's field names.
578
+ - Each carries PartnerInvoiceStringID, your own id for it, which Bkav uses to refuse a duplicate.
579
+ - Attachments are not accepted here.
580
+
581
+ **Inputs**
582
+
583
+ | Name | Type | Required | What it is |
584
+ | --- | --- | --- | --- |
585
+ | `connected_account_id` | string | yes | Bkav connected account |
586
+ | `kind` | "create_draft" \\| "create" \\| "create_draft_own_serial" \\| "create_own_number" \\| "create_own_serial" \\| "replace_draft" \\| "adjust_draft" \\| "adjust_discount_draft" \\| "replace" \\| "adjust" \\| "adjust_external_draft" \\| "adjust_discount" \\| "adjust_external" \\| "replace_external" \\| "replace_external_draft" | yes | create_draft: no number, deletable. create: Bkav numbers it. *_own_*: your form/serial. replace_* / adjust_*: each invoice names its original in Invoice.OriginalInvoiceIdentify and gives Invoice.Reason. *_external*: corrects an invoice issued outside Bkav; its first line is an ItemTypeID 4 description of it. *_draft kinds stay unnumbered. |
587
+ | `invoices` | object[] | yes | |
588
+ | `invoices[].Invoice` | object | yes | |
589
+ | `invoices[].Invoice.InvoiceTypeID` | number | yes | 1 GTGT, 2 bán hàng, 5 PXK kiêm VCNB, 6 PXK gửi bán đại lý |
590
+ | `invoices[].Invoice.InvoiceDate` | string | yes | ISO date |
591
+ | `invoices[].Invoice.BuyerCode` | string | | |
592
+ | `invoices[].Invoice.BuyerName` | string | | |
593
+ | `invoices[].Invoice.BuyerTaxCode` | string | | |
594
+ | `invoices[].Invoice.BuyerUnitName` | string | | |
595
+ | `invoices[].Invoice.BuyerAddress` | string | | |
596
+ | `invoices[].Invoice.BuyerBankAccount` | string | | Sent empty when absent: Bkav refuses it missing |
597
+ | `invoices[].Invoice.PayMethodID` | number | | 1 TM, 2 CK, 3 TM/CK, … |
598
+ | `invoices[].Invoice.ReceiveTypeID` | number | | 1 email, 2 SMS, 3 both, 4 courier |
599
+ | `invoices[].Invoice.ReceiverEmail` | string | | |
600
+ | `invoices[].Invoice.ReceiverMobile` | string | | |
601
+ | `invoices[].Invoice.ReceiverAddress` | string | | Sent empty when absent: Bkav refuses it missing |
602
+ | `invoices[].Invoice.ReceiverName` | string | | Sent empty when absent: Bkav refuses it missing |
603
+ | `invoices[].Invoice.Note` | string | | |
604
+ | `invoices[].Invoice.BillCode` | string | | Sent empty when absent: Bkav refuses it missing |
605
+ | `invoices[].Invoice.CurrencyID` | string | | |
606
+ | `invoices[].Invoice.ExchangeRate` | number | | |
607
+ | `invoices[].Invoice.InvoiceForm` | string | | Mẫu số |
608
+ | `invoices[].Invoice.InvoiceSerial` | string | | Ký hiệu |
609
+ | `invoices[].Invoice.InvoiceNo` | number | | Số; 0 when Bkav assigns it |
610
+ | `invoices[].Invoice.MaCuaCQT` | string | | Set only by a cash-register flow that already holds the authority's code |
611
+ | `invoices[].Invoice.UserDefine` | string | | JSON-encoded template fields agreed with Bkav |
612
+ | `invoices[].Invoice.UIDefine` | string | | JSON-encoded delivery-note fields (InvoiceTypeID 5 and 6) |
613
+ | `invoices[].Invoice.isBTH` | boolean | | |
614
+ | `invoices[].Invoice.CCCD` | string | | |
615
+ | `invoices[].Invoice.PassportNumber` | string | | |
616
+ | `invoices[].Invoice.FiscalCodes` | string | | |
617
+ | `invoices[].Invoice.Reason` | string | | Why — required on a replacement or adjustment |
618
+ | `invoices[].Invoice.OriginalInvoiceIdentify` | string | | `[mẫu số]_[ký hiệu]_[số]` of the invoice a replacement or adjustment corrects |
619
+ | `invoices[].Invoice.InvoiceGUID` | string | | Addresses the invoice for an update by guid |
620
+ | `invoices[].ListInvoiceDetailsWS` | object[] | yes | |
621
+ | `invoices[].ListInvoiceDetailsWS[].ItemTypeID` | number | | 0 goods, 4 description line, 15 promotional goods, … |
622
+ | `invoices[].ListInvoiceDetailsWS[].IsDiscount` | boolean | | |
623
+ | `invoices[].ListInvoiceDetailsWS[].ItemCode` | string | | |
624
+ | `invoices[].ListInvoiceDetailsWS[].ItemName` | string | yes | |
625
+ | `invoices[].ListInvoiceDetailsWS[].UnitName` | string | | |
626
+ | `invoices[].ListInvoiceDetailsWS[].Qty` | number | | |
627
+ | `invoices[].ListInvoiceDetailsWS[].Price` | number | | |
628
+ | `invoices[].ListInvoiceDetailsWS[].Amount` | number | | |
629
+ | `invoices[].ListInvoiceDetailsWS[].TaxRateID` | number | | 1 0%, 2 5%, 3 10%, 4 không chịu thuế, 9 8%, … |
630
+ | `invoices[].ListInvoiceDetailsWS[].TaxRate` | number | | |
631
+ | `invoices[].ListInvoiceDetailsWS[].TaxAmount` | number | | |
632
+ | `invoices[].ListInvoiceDetailsWS[].OtherAmount` | number | | |
633
+ | `invoices[].ListInvoiceDetailsWS[].DiscountRate` | number | | |
634
+ | `invoices[].ListInvoiceDetailsWS[].DiscountAmount` | number | | |
635
+ | `invoices[].ListInvoiceDetailsWS[].UserDefineDetails` | string | | |
636
+ | `invoices[].ListInvoiceDetailsWS[].IsIncrease` | boolean \\| null | | On an adjustment: true raises the amount, false lowers it, absent adjusts information |
637
+ | `invoices[].ListInvoiceDetailsWS[].SpecialtyItems` | string | | |
638
+ | `invoices[].PartnerInvoiceStringID` | string | yes | |
639
+ | `invoices[].AttachListNumber` | string | | Số of a bảng kê the invoice refers to |
640
+ | `invoices[].AttachListDate` | string | | |
641
+
642
+ **Answer**
643
+
644
+ | Name | Type | Required | What it is |
645
+ | --- | --- | --- | --- |
646
+ | `results` | object[] | yes | |
647
+ | `results[].PartnerInvoiceID` | number | yes | |
648
+ | `results[].PartnerInvoiceStringID` | string \\| null | yes | Null on a delete's answer |
649
+ | `results[].InvoiceGUID` | string | yes | |
650
+ | `results[].InvoiceForm` | string \\| null | yes | Null on a draft's link answer |
651
+ | `results[].InvoiceSerial` | string \\| null | yes | Null on a draft's link answer |
652
+ | `results[].InvoiceNo` | number | yes | Assigned by a numbered kind; 0 on a draft |
653
+ | `results[].MTC` | string \\| null | yes | Mã tra cứu the buyer looks the invoice up with; null on a draft's link answer |
654
+ | `results[].MaCuaCQT` | string \\| null | | |
655
+ | `results[].Status` | number | yes | 0 succeeded; otherwise MessLog says why |
656
+ | `results[].MessLog` | string | yes | |
657
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
658
+
659
+ ### bkav_update_invoices (workflow step)
660
+
661
+ - Change invoices not yet issued. by names how each invoice is found: partner (its partner id), number (Invoice.InvoiceForm + InvoiceSerial + InvoiceNo) or guid (Invoice.InvoiceGUID).
662
+
663
+ **Inputs**
664
+
665
+ | Name | Type | Required | What it is |
666
+ | --- | --- | --- | --- |
667
+ | `connected_account_id` | string | yes | Bkav connected account |
668
+ | `by` | "partner" \\| "number" \\| "guid" | yes | |
669
+ | `invoices` | object[] | yes | |
670
+ | `invoices[].Invoice` | object | yes | |
671
+ | `invoices[].Invoice.InvoiceTypeID` | number | yes | 1 GTGT, 2 bán hàng, 5 PXK kiêm VCNB, 6 PXK gửi bán đại lý |
672
+ | `invoices[].Invoice.InvoiceDate` | string | yes | ISO date |
673
+ | `invoices[].Invoice.BuyerCode` | string | | |
674
+ | `invoices[].Invoice.BuyerName` | string | | |
675
+ | `invoices[].Invoice.BuyerTaxCode` | string | | |
676
+ | `invoices[].Invoice.BuyerUnitName` | string | | |
677
+ | `invoices[].Invoice.BuyerAddress` | string | | |
678
+ | `invoices[].Invoice.BuyerBankAccount` | string | | Sent empty when absent: Bkav refuses it missing |
679
+ | `invoices[].Invoice.PayMethodID` | number | | 1 TM, 2 CK, 3 TM/CK, … |
680
+ | `invoices[].Invoice.ReceiveTypeID` | number | | 1 email, 2 SMS, 3 both, 4 courier |
681
+ | `invoices[].Invoice.ReceiverEmail` | string | | |
682
+ | `invoices[].Invoice.ReceiverMobile` | string | | |
683
+ | `invoices[].Invoice.ReceiverAddress` | string | | Sent empty when absent: Bkav refuses it missing |
684
+ | `invoices[].Invoice.ReceiverName` | string | | Sent empty when absent: Bkav refuses it missing |
685
+ | `invoices[].Invoice.Note` | string | | |
686
+ | `invoices[].Invoice.BillCode` | string | | Sent empty when absent: Bkav refuses it missing |
687
+ | `invoices[].Invoice.CurrencyID` | string | | |
688
+ | `invoices[].Invoice.ExchangeRate` | number | | |
689
+ | `invoices[].Invoice.InvoiceForm` | string | | Mẫu số |
690
+ | `invoices[].Invoice.InvoiceSerial` | string | | Ký hiệu |
691
+ | `invoices[].Invoice.InvoiceNo` | number | | Số; 0 when Bkav assigns it |
692
+ | `invoices[].Invoice.MaCuaCQT` | string | | Set only by a cash-register flow that already holds the authority's code |
693
+ | `invoices[].Invoice.UserDefine` | string | | JSON-encoded template fields agreed with Bkav |
694
+ | `invoices[].Invoice.UIDefine` | string | | JSON-encoded delivery-note fields (InvoiceTypeID 5 and 6) |
695
+ | `invoices[].Invoice.isBTH` | boolean | | |
696
+ | `invoices[].Invoice.CCCD` | string | | |
697
+ | `invoices[].Invoice.PassportNumber` | string | | |
698
+ | `invoices[].Invoice.FiscalCodes` | string | | |
699
+ | `invoices[].Invoice.Reason` | string | | Why — required on a replacement or adjustment |
700
+ | `invoices[].Invoice.OriginalInvoiceIdentify` | string | | `[mẫu số]_[ký hiệu]_[số]` of the invoice a replacement or adjustment corrects |
701
+ | `invoices[].Invoice.InvoiceGUID` | string | | Addresses the invoice for an update by guid |
702
+ | `invoices[].ListInvoiceDetailsWS` | object[] | yes | |
703
+ | `invoices[].ListInvoiceDetailsWS[].ItemTypeID` | number | | 0 goods, 4 description line, 15 promotional goods, … |
704
+ | `invoices[].ListInvoiceDetailsWS[].IsDiscount` | boolean | | |
705
+ | `invoices[].ListInvoiceDetailsWS[].ItemCode` | string | | |
706
+ | `invoices[].ListInvoiceDetailsWS[].ItemName` | string | yes | |
707
+ | `invoices[].ListInvoiceDetailsWS[].UnitName` | string | | |
708
+ | `invoices[].ListInvoiceDetailsWS[].Qty` | number | | |
709
+ | `invoices[].ListInvoiceDetailsWS[].Price` | number | | |
710
+ | `invoices[].ListInvoiceDetailsWS[].Amount` | number | | |
711
+ | `invoices[].ListInvoiceDetailsWS[].TaxRateID` | number | | 1 0%, 2 5%, 3 10%, 4 không chịu thuế, 9 8%, … |
712
+ | `invoices[].ListInvoiceDetailsWS[].TaxRate` | number | | |
713
+ | `invoices[].ListInvoiceDetailsWS[].TaxAmount` | number | | |
714
+ | `invoices[].ListInvoiceDetailsWS[].OtherAmount` | number | | |
715
+ | `invoices[].ListInvoiceDetailsWS[].DiscountRate` | number | | |
716
+ | `invoices[].ListInvoiceDetailsWS[].DiscountAmount` | number | | |
717
+ | `invoices[].ListInvoiceDetailsWS[].UserDefineDetails` | string | | |
718
+ | `invoices[].ListInvoiceDetailsWS[].IsIncrease` | boolean \\| null | | On an adjustment: true raises the amount, false lowers it, absent adjusts information |
719
+ | `invoices[].ListInvoiceDetailsWS[].SpecialtyItems` | string | | |
720
+ | `invoices[].PartnerInvoiceStringID` | string | yes | |
721
+ | `invoices[].AttachListNumber` | string | | Số of a bảng kê the invoice refers to |
722
+ | `invoices[].AttachListDate` | string | | |
723
+
724
+ **Answer**
725
+
726
+ | Name | Type | Required | What it is |
727
+ | --- | --- | --- | --- |
728
+ | `results` | object[] | yes | |
729
+ | `results[].PartnerInvoiceID` | number | yes | |
730
+ | `results[].PartnerInvoiceStringID` | string \\| null | yes | Null on a delete's answer |
731
+ | `results[].InvoiceGUID` | string | yes | |
732
+ | `results[].InvoiceForm` | string \\| null | yes | Null on a draft's link answer |
733
+ | `results[].InvoiceSerial` | string \\| null | yes | Null on a draft's link answer |
734
+ | `results[].InvoiceNo` | number | yes | Assigned by a numbered kind; 0 on a draft |
735
+ | `results[].MTC` | string \\| null | yes | Mã tra cứu the buyer looks the invoice up with; null on a draft's link answer |
736
+ | `results[].MaCuaCQT` | string \\| null | | |
737
+ | `results[].Status` | number | yes | 0 succeeded; otherwise MessLog says why |
738
+ | `results[].MessLog` | string | yes | |
739
+ | `failed` | number | yes | Invoices whose own Status is not 0 |
740
+
741
+ ## drive
742
+
743
+ ### drive_export_file (workflow step)
744
+
745
+ - Upload a Lotics file to the member's Google Drive.
746
+ - The file is uploaded as-is — a .docx stays a .docx, a .xlsx stays a .xlsx.
747
+ - It is deliberately NOT converted into a Google Doc or Sheet: conversion re-flows the layout of a generated document, and a native Google file is live, so its figures would drift away from the record they came from.
748
+ - Use this to archive a finished document, the way you would attach it to an email.
749
+
750
+ **Inputs**
751
+
752
+ | Name | Type | Required | What it is |
753
+ | --- | --- | --- | --- |
754
+ | `connected_account_id` | string | yes | The ID of the connected Google Drive account to use |
755
+ | `file_id` | string | yes | Lotics file ID to upload |
756
+ | `folder_id` | string | | Drive folder ID to place the file in; omit for the member's Drive root |
757
+
758
+ **Answer**
759
+
760
+ | Name | Type | Required | What it is |
761
+ | --- | --- | --- | --- |
762
+ | `drive_file_id` | string | yes | Drive file ID of the uploaded copy |
763
+ | `web_view_link` | string \\| null | yes | URL to open the uploaded file in Drive |
764
+
765
+ ### drive_import_file (workflow step)
766
+
767
+ - Import a Google Drive file into the workspace as a Lotics file, and return its file id.
768
+ - Google Docs arrive as .docx, Sheets as .xlsx, Slides as .pptx; everything else transfers unchanged. **This is also how you READ a Drive file.** There is no separate Drive read tool: import the file, then use `view_files` on the returned id. (workflow step, chat)
769
+ - That path handles scanned documents — a photographed B/L or a stamped invoice inside a .docx reaches the model as a picture.
770
+ - Exporting Drive content as plain text would return an empty document for exactly those files.
771
+ - Folders, Forms, shortcuts and other Drive items with no file form cannot be imported.
772
+
773
+ **Inputs**
774
+
775
+ | Name | Type | Required | What it is |
776
+ | --- | --- | --- | --- |
777
+ | `connected_account_id` | string | yes | The ID of the connected Google Drive account to use |
778
+ | `file_id` | string | yes | Drive file ID, from drive_query_files (workflow step, chat) |
779
+
780
+ **Answer**
781
+
782
+ | Name | Type | Required | What it is |
783
+ | --- | --- | --- | --- |
784
+ | `id` | string | yes | Lotics file ID — pass this to view_files to read the contents (workflow step, chat) |
785
+ | `filename` | string | yes | |
786
+ | `mime_type` | string | yes | |
787
+ | `url` | string | yes | |
788
+
789
+ ### drive_query_files (workflow step)
790
+
791
+ - Search the member's Google Drive using Drive query syntax. ## Query syntax Terms are `field operator value`; combine with `and` / `or` / `not`.
792
+ - String values are single-quoted. - Name: `name = 'Rate card'`, `name contains 'invoice'` - Full text (body + title): `fullText contains 'CMA CGM'` - Type: `mimeType = 'application/vnd.google-apps.spreadsheet'`, `mimeType contains 'pdf'` - Folder: `'<folder_id>' in parents` - Time (RFC 3339): `modifiedTime > '2026-01-01T00:00:00'` - Exclude deleted: `trashed = false` (always worth adding) - Starred / shared: `starred = true`, `sharedWithMe = true` Google-native types: `application/vnd.google-apps.document` (Docs), `.spreadsheet` (Sheets), `.presentation` (Slides), `.folder`.
793
+ - Examples: - `name contains 'packing list' and trashed = false` - `'1a2b3c' in parents and modifiedTime > '2026-08-01T00:00:00'` - `fullText contains 'demurrage' and mimeType = 'application/vnd.google-apps.document'` Results carry enough metadata (name, type, modified time, size, owner) to pick a file WITHOUT importing it.
794
+ - Import only the one you actually need — `drive_import_file` persists a copy in the workspace. (workflow step, chat)
795
+
796
+ **Inputs**
797
+
798
+ | Name | Type | Required | What it is |
799
+ | --- | --- | --- | --- |
800
+ | `connected_account_id` | string | yes | The ID of the connected Google Drive account to use |
801
+ | `query` | string | yes | Drive query syntax expression |
802
+ | `max_result` | number | yes | Maximum number of files to retrieve (1-50) |
803
+ | `order_by` | string | | Sort order, e.g. 'modifiedTime desc', 'name' |
804
+
805
+ **Answer**
806
+
807
+ | Name | Type | Required | What it is |
808
+ | --- | --- | --- | --- |
809
+ | `files` | object[] | yes | List of matching Drive files |
810
+ | `files[].id` | string | yes | Drive file ID — pass this to drive_import_file (workflow step, chat) |
811
+ | `files[].name` | string | yes | File name as it appears in Drive |
812
+ | `files[].mime_type` | string | yes | Drive MIME type; 'application/vnd.google-apps.*' means Google-native |
813
+ | `files[].modified_time` | string \\| null | yes | RFC 3339 timestamp of the last modification |
814
+ | `files[].size_bytes` | number \\| null | yes | Size in bytes; null for Google-native files, which have no stored size until exported |
815
+ | `files[].owner` | string \\| null | yes | Email address of the file's owner |
816
+ | `files[].web_view_link` | string \\| null | yes | URL to open the file in Drive |
817
+
818
+ ## evaluate
819
+
820
+ ### evaluate_formula (workflow step)
821
+
822
+ - Compute a formula over one record as its table's own formula fields compute: fields referenced as `{fld_…}`, lookups and rollups read as the row holds them.
823
+ - Writes nothing.
824
+
825
+ **Inputs**
826
+
827
+ | Name | Type | Required | What it is |
828
+ | --- | --- | --- | --- |
829
+ | `table_id` | string | yes | |
830
+ | `record_id` | string | yes | |
831
+ | `expression` | string | yes | |
832
+
833
+ **Answer**
834
+
835
+ | Name | Type | Required | What it is |
836
+ | --- | --- | --- | --- |
837
+ | `value` | number \\| string \\| boolean \\| null | yes | |
838
+
839
+ ## excel
840
+
841
+ ### excel_create_file (workflow step)
842
+
843
+ - Create an Excel file with styled column headers and auto-filter enabled.
844
+ - Input: { filename, sheets: [{ name, columns: [{ header, width? }], rows: unknown[][] }] } Headers are bold, centered, bordered, with auto-filter on the header row.
845
+ - Best for producing polished report-style spreadsheets.
846
+ - Returns a new file_id — use it for subsequent operations.
847
+
848
+ **Inputs**
849
+
850
+ | Name | Type | Required | What it is |
851
+ | --- | --- | --- | --- |
852
+ | `sheets` | object[] | yes | |
853
+ | `sheets[].name` | string | yes | |
854
+ | `sheets[].columns` | object[] | yes | |
855
+ | `sheets[].columns[].header` | string | yes | |
856
+ | `sheets[].columns[].width` | number | | |
857
+ | `sheets[].rows` | any[][] | yes | 2D array of cell values |
858
+ | `filename` | string | yes | |
859
+
860
+ **Answer**
861
+
862
+ | Name | Type | Required | What it is |
863
+ | --- | --- | --- | --- |
864
+ | `file_id` | string | yes | The ID of the generated file. |
865
+ | `url` | string | yes | The download URL of the generated file. |
866
+ | `filename` | string | yes | The filename of the generated file, including extension. |
867
+ | `mime_type` | string | yes | The MIME type of the generated file. |
868
+
869
+ ### excel_find_cells (workflow step)
870
+
871
+ - Search for cells matching a text query in an Excel worksheet.
872
+ - Input: { file_id, worksheet: string\|number, query: "search text", match_type?: "contains"\|"exact"\|"regex", max_results?: number } Default match_type is "contains" (case-insensitive).
873
+ - Returns matching cell addresses, values, and positions.
874
+ - Read-only — does not modify the file.
875
+
876
+ **Inputs**
877
+
878
+ | Name | Type | Required | What it is |
879
+ | --- | --- | --- | --- |
880
+ | `file_id` | string | yes | |
881
+ | `worksheet` | string \\| number | yes | |
882
+ | `query` | string | yes | Text to find. |
883
+ | `match_type` | "exact" \\| "contains" \\| "regex" | | How to match: exact, contains (default), or regex |
884
+ | `max_results` | number | | Max matches to return |
885
+
886
+ **Answer**
887
+
888
+ | Name | Type | Required | What it is |
889
+ | --- | --- | --- | --- |
890
+ | `matches` | object[] | yes | |
891
+ | `matches[].cell` | string | yes | Cell address, e.g. B3 |
892
+ | `matches[].value` | string | yes | Cell value as string |
893
+ | `matches[].row` | number | yes | Row number |
894
+ | `matches[].column` | string | yes | Column letter |
895
+ | `total_matches` | number | yes | Total number of matches found |
896
+
897
+ ### excel_format_range (workflow step)
898
+
899
+ - Apply formatting to a cell range (fonts, fills, borders, alignment, number formats). range format is always "START:END" — single cell: "B2:B2", multi-cell: "A1:D10".
900
+ - Never use "B2" alone.
901
+
902
+ **Inputs**
903
+
904
+ | Name | Type | Required | What it is |
905
+ | --- | --- | --- | --- |
906
+ | `file_id` | string | yes | |
907
+ | `worksheet` | string \\| number | yes | |
908
+ | `range` | string | yes | |
909
+ | `format` | object | yes | |
910
+ | `format.font_bold` | boolean | | |
911
+ | `format.font_italic` | boolean | | |
912
+ | `format.font_size` | number | | |
913
+ | `format.font_color` | string | | Hex color like #FF0000 |
914
+ | `format.font_name` | string | | |
915
+ | `format.font_underline` | "single" \\| "double" | | |
916
+ | `format.font_strike` | boolean | | |
917
+ | `format.background_color` | string | | Hex color like #FFFF00 |
918
+ | `format.horizontal_align` | "left" \\| "center" \\| "right" | | |
919
+ | `format.vertical_align` | "top" \\| "middle" \\| "bottom" | | |
920
+ | `format.wrap_text` | boolean | | |
921
+ | `format.number_format` | string | | Excel number format code (e.g. #,##0.00, dd/mm/yyyy) |
922
+ | `format.border_top` | object | | |
923
+ | `format.border_top.style` | "solid" \\| "dashed" \\| "dotted" \\| "double" | | |
924
+ | `format.border_top.width` | number | | |
925
+ | `format.border_top.color` | string | | |
926
+ | `format.border_bottom` | object | | |
927
+ | `format.border_bottom.style` | "solid" \\| "dashed" \\| "dotted" \\| "double" | | |
928
+ | `format.border_bottom.width` | number | | |
929
+ | `format.border_bottom.color` | string | | |
930
+ | `format.border_left` | object | | |
931
+ | `format.border_left.style` | "solid" \\| "dashed" \\| "dotted" \\| "double" | | |
932
+ | `format.border_left.width` | number | | |
933
+ | `format.border_left.color` | string | | |
934
+ | `format.border_right` | object | | |
935
+ | `format.border_right.style` | "solid" \\| "dashed" \\| "dotted" \\| "double" | | |
936
+ | `format.border_right.width` | number | | |
937
+ | `format.border_right.color` | string | | |
938
+ | `column_widths` | object | | Column letter → width mapping |
939
+ | `row_heights` | object | | Row number → height mapping |
940
+ | `auto_filter` | string | | Range for an auto-filter (e.g. A1:D1); one over a table turns on that table's own filter |
941
+
942
+ **Answer**
943
+
944
+ | Name | Type | Required | What it is |
945
+ | --- | --- | --- | --- |
946
+ | `file_id` | string | yes | |
947
+ | `formatted_cells` | number | yes | |
948
+
949
+ ### excel_get_range (workflow step)
950
+
951
+ - Read cell values from a range in an Excel worksheet. range format is always "START:END" — single cell: "B2:B2", multi-cell: "A1:D10".
952
+ - Never use "B2" alone. worksheet: use sheet name (preferred) or 0-based index.
953
+ - Use view_file first to see available worksheets.
954
+ - Returns data keyed by row number then column letter, e.g. { "1": { "A": "Hello" } }.
955
+ - Maximum 1000 cells per call — use smaller ranges and paginate if needed.
956
+ - Read-only — does not modify the file.
957
+
958
+ **Inputs**
959
+
960
+ | Name | Type | Required | What it is |
961
+ | --- | --- | --- | --- |
962
+ | `file_id` | string | yes | |
963
+ | `worksheet` | string \\| number | yes | |
964
+ | `range` | string | yes | |
965
+ | `options` | object | | Options for data retrieval |
966
+ | `options.include_formulas` | boolean | | Include cell formulas instead of calculated values |
967
+ | `options.include_formatting` | boolean | | Include cell formatting information |
968
+ | `options.max_cell_length` | number | | Max characters returned per cell; longer text is truncated with an ellipsis. Pass -1 to return cells in full — use when reading free-text columns like notes. |
969
+
970
+ **Answer**
971
+
972
+ | Name | Type | Required | What it is |
973
+ | --- | --- | --- | --- |
974
+ | `file_id` | string | yes | |
975
+ | `worksheet_name` | string | yes | The worksheet name |
976
+ | `range` | string | yes | The requested range |
977
+ | `data` | object | yes | Cell values keyed by row number then column letter |
978
+ | `formatting` | object | | Cell formatting keyed by row then column |
979
+ | `truncated_cells` | object[] | | Cells with truncated content |
980
+ | `truncated_cells[].cell` | string | yes | Cell address |
981
+ | `truncated_cells[].original_length` | number | yes | Original text length |
982
+
983
+ ### excel_update_range (workflow step)
984
+
985
+ - Write cell values into a range in an Excel worksheet. range format is always "START:END" — single cell: "B2:B2", multi-cell: "A1:C3".
986
+ - Never use "B2" alone. values is a 2D array matching the range dimensions.
987
+ - Single cell: [["value"]], row: [["a","b","c"]], grid: [[r1...],[r2...]].
988
+ - Strings starting with "=" are interpreted as formulas (e.g. "=SUM(A1:A10)").
989
+ - Set options.interpret_formulas=false to write literal "=" text.
990
+ - Modifies the document in place.
991
+
992
+ **Inputs**
993
+
994
+ | Name | Type | Required | What it is |
995
+ | --- | --- | --- | --- |
996
+ | `file_id` | string | yes | |
997
+ | `worksheet` | string \\| number | yes | |
998
+ | `range` | string | yes | |
999
+ | `values` | any[][] | yes | 2D array of values to write (rows x columns) |
1000
+ | `options` | object | | |
1001
+ | `options.preserve_formatting` | boolean | | Preserve existing cell formatting (only update values) |
1002
+ | `options.apply_number_format` | string | | Apply a number format to all cells in the range (e.g., '#,##0.00') |
1003
+ | `options.interpret_formulas` | boolean | | Set false to write '=' strings as literal text |
1004
+
1005
+ **Answer**
1006
+
1007
+ | Name | Type | Required | What it is |
1008
+ | --- | --- | --- | --- |
1009
+ | `file_id` | string | yes | |
1010
+ | `worksheet_name` | string | yes | |
1011
+ | `range` | string | yes | |
1012
+ | `updated_cells` | number | yes | Number of cells updated |
1013
+
1014
+ ## facebook
1015
+
1016
+ ### facebook_create_post (workflow step)
1017
+
1018
+ - Publish a post to a Facebook Page feed.
1019
+ - Requires a Facebook connected account whose page allows content management.
1020
+
1021
+ **Inputs**
1022
+
1023
+ | Name | Type | Required | What it is |
1024
+ | --- | --- | --- | --- |
1025
+ | `connected_account_id` | string | yes | |
1026
+ | `page_id` | string | yes | Facebook Page to post to — one of the connected account's managed pages. |
1027
+ | `message` | string | yes | |
1028
+ | `link` | string | | A post carries either a link or media. |
1029
+ | `media_file_ids` | string[] | | Photos, or one video on its own. |
1030
+
1031
+ **Answer**
1032
+
1033
+ | Name | Type | Required | What it is |
1034
+ | --- | --- | --- | --- |
1035
+ | `post_id` | string | yes | |
1036
+ | `url` | string | yes | |
1037
+
1038
+ ### facebook_list_comments (workflow step)
1039
+
1040
+ - Read the most recent comments left on a Facebook Page's posts.
1041
+ - Reply with facebook_reply_to_comment, passing the comment_id. (workflow step)
1042
+
1043
+ **Inputs**
1044
+
1045
+ | Name | Type | Required | What it is |
1046
+ | --- | --- | --- | --- |
1047
+ | `connected_account_id` | string | yes | |
1048
+ | `page_id` | string | yes | One of the connected account's managed pages. |
1049
+ | `limit` | integer | | |
1050
+
1051
+ **Answer**
1052
+
1053
+ | Name | Type | Required | What it is |
1054
+ | --- | --- | --- | --- |
1055
+ | `comments` | object[] | yes | |
1056
+ | `comments[].comment_id` | string | yes | |
1057
+ | `comments[].post_id` | string | yes | |
1058
+ | `comments[].author_id` | string | yes | |
1059
+ | `comments[].author_name` | string | yes | |
1060
+ | `comments[].message` | string | yes | |
1061
+ | `comments[].created_time` | string | yes | |
1062
+
1063
+ ### facebook_list_conversations (workflow step)
1064
+
1065
+ - Read a Facebook Page's Messenger conversations with their recent messages.
1066
+ - Answer someone with facebook_send_message, passing the person_id. (workflow step)
1067
+
1068
+ **Inputs**
1069
+
1070
+ | Name | Type | Required | What it is |
1071
+ | --- | --- | --- | --- |
1072
+ | `connected_account_id` | string | yes | |
1073
+ | `page_id` | string | yes | One of the connected account's managed pages. |
1074
+ | `limit` | integer | | |
1075
+
1076
+ **Answer**
1077
+
1078
+ | Name | Type | Required | What it is |
1079
+ | --- | --- | --- | --- |
1080
+ | `conversations` | object[] | yes | |
1081
+ | `conversations[].conversation_id` | string | yes | |
1082
+ | `conversations[].person_id` | string \\| null | yes | |
1083
+ | `conversations[].person_name` | string \\| null | yes | |
1084
+ | `conversations[].messages` | object[] | yes | |
1085
+ | `conversations[].messages[].from_id` | string | yes | |
1086
+ | `conversations[].messages[].from_name` | string | yes | |
1087
+ | `conversations[].messages[].message` | string | yes | |
1088
+ | `conversations[].messages[].created_time` | string | yes | |
1089
+
1090
+ ### facebook_reply_to_comment (workflow step)
1091
+
1092
+ - Reply publicly to a comment on a Facebook Page post, as the page.
1093
+ - The reply is visible to everyone who can see the comment.
1094
+
1095
+ **Inputs**
1096
+
1097
+ | Name | Type | Required | What it is |
1098
+ | --- | --- | --- | --- |
1099
+ | `connected_account_id` | string | yes | |
1100
+ | `page_id` | string | yes | The page that owns the post the comment is on. |
1101
+ | `comment_id` | string | yes | From facebook_list_comments. (workflow step) |
1102
+ | `message` | string | yes | |
1103
+
1104
+ **Answer**
1105
+
1106
+ | Name | Type | Required | What it is |
1107
+ | --- | --- | --- | --- |
1108
+ | `comment_id` | string | yes | The reply's own id. |
1109
+
1110
+ ### facebook_send_message (workflow step)
1111
+
1112
+ - Answer someone who messaged a Facebook Page, as the page.
1113
+ - Meta accepts a reply only within 24 hours of that person's last message.
1114
+
1115
+ **Inputs**
1116
+
1117
+ | Name | Type | Required | What it is |
1118
+ | --- | --- | --- | --- |
1119
+ | `connected_account_id` | string | yes | |
1120
+ | `page_id` | string | yes | The page the person wrote to. |
1121
+ | `person_id` | string | yes | From facebook_list_conversations. Page-scoped to this page. (workflow step) |
1122
+ | `message` | string | yes | |
1123
+
1124
+ **Answer**
1125
+
1126
+ | Name | Type | Required | What it is |
1127
+ | --- | --- | --- | --- |
1128
+ | `message_id` | string | yes | |
1129
+
1130
+ ## fedex
1131
+
1132
+ ### fedex_cancel_draft (workflow step)
1133
+
1134
+ - Cancel (delete) an unconfirmed FedEx draft (Open Ship) booking by its reference.
1135
+
1136
+ **Inputs**
1137
+
1138
+ | Name | Type | Required | What it is |
1139
+ | --- | --- | --- | --- |
1140
+ | `connected_account_id` | string | yes | FedEx connected account |
1141
+ | `reference` | string | yes | The draft's reference (Open Ship index) |
1142
+
1143
+ **Answer**
1144
+
1145
+ | Name | Type | Required | What it is |
1146
+ | --- | --- | --- | --- |
1147
+ | `cancelled` | boolean | yes | |
1148
+
1149
+ ### fedex_confirm_shipment (workflow step)
1150
+
1151
+ - Confirm a FedEx draft (Open Ship) booking by its reference, generating the label / AWB.
1152
+ - Returns the master tracking number and any piece tracking numbers + label URLs.
1153
+
1154
+ **Inputs**
1155
+
1156
+ | Name | Type | Required | What it is |
1157
+ | --- | --- | --- | --- |
1158
+ | `connected_account_id` | string | yes | FedEx connected account |
1159
+ | `reference` | string | yes | The draft's reference (Open Ship index) from fedex_create_draft_shipment (workflow step) |
1160
+ | `master_tracking_number` | string | | The master_tracking_number returned by fedex_create_draft_shipment — required to finalize the label (workflow step) |
1161
+
1162
+ **Answer**
1163
+
1164
+ | Name | Type | Required | What it is |
1165
+ | --- | --- | --- | --- |
1166
+ | `master_tracking_number` | string | | |
1167
+ | `tracking_numbers` | string[] | yes | |
1168
+ | `label_urls` | string[] | yes | |
1169
+
1170
+ ### fedex_create_draft_shipment (workflow step)
1171
+
1172
+ - Create a FedEx draft (Open Ship) booking — no label yet.
1173
+ - Confirm later with fedex_confirm_shipment. reference is a unique key you choose (e.g. the shipment order number) used to confirm or cancel. (workflow step)
1174
+ - Supports multiple packages, special services, and (international) customs commodities.
1175
+
1176
+ **Inputs**
1177
+
1178
+ | Name | Type | Required | What it is |
1179
+ | --- | --- | --- | --- |
1180
+ | `connected_account_id` | string | yes | FedEx connected account |
1181
+ | `reference` | string | yes | Unique key for this draft (the Open Ship index) |
1182
+ | `shipper` | object | yes | |
1183
+ | `shipper.contact` | object | | |
1184
+ | `shipper.contact.person_name` | string | | |
1185
+ | `shipper.contact.company_name` | string | | |
1186
+ | `shipper.contact.phone_number` | string | | |
1187
+ | `shipper.address` | object | yes | |
1188
+ | `shipper.address.postal_code` | string | yes | |
1189
+ | `shipper.address.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1190
+ | `shipper.address.city` | string | | |
1191
+ | `shipper.address.state_or_province_code` | string | | |
1192
+ | `shipper.address.street_lines` | string[] | | |
1193
+ | `shipper.address.residential` | boolean | | |
1194
+ | `recipient` | object | yes | |
1195
+ | `recipient.contact` | object | | |
1196
+ | `recipient.contact.person_name` | string | | |
1197
+ | `recipient.contact.company_name` | string | | |
1198
+ | `recipient.contact.phone_number` | string | | |
1199
+ | `recipient.address` | object | yes | |
1200
+ | `recipient.address.postal_code` | string | yes | |
1201
+ | `recipient.address.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1202
+ | `recipient.address.city` | string | | |
1203
+ | `recipient.address.state_or_province_code` | string | | |
1204
+ | `recipient.address.street_lines` | string[] | | |
1205
+ | `recipient.address.residential` | boolean | | |
1206
+ | `service_type` | string | yes | FedEx service type e.g. INTERNATIONAL_PRIORITY |
1207
+ | `packaging_type` | string | | FedEx packaging type e.g. YOUR_PACKAGING |
1208
+ | `packages` | object[] | yes | One entry per package; weight in kg |
1209
+ | `packages[].weight` | number | yes | |
1210
+ | `packages[].weight_units` | "KG" \\| "LB" | | Weight units; FedEx requires LB for US domestic express |
1211
+ | `packages[].length` | number | | |
1212
+ | `packages[].width` | number | | |
1213
+ | `packages[].height` | number | | |
1214
+ | `packages[].dimension_units` | "CM" \\| "IN" | | |
1215
+ | `ship_datestamp` | string | | Ship date YYYY-MM-DD |
1216
+ | `pickup_type` | string | | FedEx pickup type e.g. USE_SCHEDULED_PICKUP |
1217
+ | `special_services` | string[] | | FedEx special service types e.g. SATURDAY_DELIVERY, FEDEX_ONE_RATE |
1218
+ | `commodities` | object[] | | Customs commodities for international shipments |
1219
+ | `commodities[].description` | string | yes | |
1220
+ | `commodities[].quantity` | number | yes | |
1221
+ | `commodities[].customs_value` | number | yes | |
1222
+ | `commodities[].currency` | string | yes | |
1223
+ | `commodities[].weight` | number | yes | |
1224
+ | `commodities[].weight_units` | "KG" \\| "LB" | | |
1225
+ | `commodities[].country_of_manufacture` | string | | ISO 3166-1 alpha-2 |
1226
+
1227
+ **Answer**
1228
+
1229
+ | Name | Type | Required | What it is |
1230
+ | --- | --- | --- | --- |
1231
+ | `reference` | string | yes | |
1232
+ | `status` | "draft" | yes | |
1233
+ | `master_tracking_number` | string | | Pass this to fedex_confirm_shipment to finalize the draft (workflow step) |
1234
+
1235
+ ### fedex_create_shipment (workflow step)
1236
+
1237
+ - Create a FedEx shipment and generate the label / AWB in one call.
1238
+ - Returns the master tracking number, piece tracking numbers, and label URLs.
1239
+ - Use the Open Ship draft flow instead when you need to stage a booking before committing.
1240
+
1241
+ **Inputs**
1242
+
1243
+ | Name | Type | Required | What it is |
1244
+ | --- | --- | --- | --- |
1245
+ | `connected_account_id` | string | yes | FedEx connected account |
1246
+ | `shipper` | object | yes | |
1247
+ | `shipper.contact` | object | | |
1248
+ | `shipper.contact.person_name` | string | | |
1249
+ | `shipper.contact.company_name` | string | | |
1250
+ | `shipper.contact.phone_number` | string | | |
1251
+ | `shipper.address` | object | yes | |
1252
+ | `shipper.address.postal_code` | string | yes | |
1253
+ | `shipper.address.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1254
+ | `shipper.address.city` | string | | |
1255
+ | `shipper.address.state_or_province_code` | string | | |
1256
+ | `shipper.address.street_lines` | string[] | | |
1257
+ | `shipper.address.residential` | boolean | | |
1258
+ | `recipient` | object | yes | |
1259
+ | `recipient.contact` | object | | |
1260
+ | `recipient.contact.person_name` | string | | |
1261
+ | `recipient.contact.company_name` | string | | |
1262
+ | `recipient.contact.phone_number` | string | | |
1263
+ | `recipient.address` | object | yes | |
1264
+ | `recipient.address.postal_code` | string | yes | |
1265
+ | `recipient.address.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1266
+ | `recipient.address.city` | string | | |
1267
+ | `recipient.address.state_or_province_code` | string | | |
1268
+ | `recipient.address.street_lines` | string[] | | |
1269
+ | `recipient.address.residential` | boolean | | |
1270
+ | `service_type` | string | yes | FedEx service type e.g. INTERNATIONAL_PRIORITY |
1271
+ | `packaging_type` | string | | FedEx packaging type e.g. YOUR_PACKAGING |
1272
+ | `packages` | object[] | yes | One entry per package; weight in kg |
1273
+ | `packages[].weight` | number | yes | |
1274
+ | `packages[].weight_units` | "KG" \\| "LB" | | Weight units; FedEx requires LB for US domestic express |
1275
+ | `packages[].length` | number | | |
1276
+ | `packages[].width` | number | | |
1277
+ | `packages[].height` | number | | |
1278
+ | `packages[].dimension_units` | "CM" \\| "IN" | | |
1279
+ | `ship_datestamp` | string | | Ship date YYYY-MM-DD |
1280
+ | `pickup_type` | string | | FedEx pickup type e.g. USE_SCHEDULED_PICKUP |
1281
+ | `special_services` | string[] | | FedEx special service types |
1282
+ | `commodities` | object[] | | Customs commodities for international shipments |
1283
+ | `commodities[].description` | string | yes | |
1284
+ | `commodities[].quantity` | number | yes | |
1285
+ | `commodities[].customs_value` | number | yes | |
1286
+ | `commodities[].currency` | string | yes | |
1287
+ | `commodities[].weight` | number | yes | |
1288
+ | `commodities[].weight_units` | "KG" \\| "LB" | | |
1289
+ | `commodities[].country_of_manufacture` | string | | ISO 3166-1 alpha-2 |
1290
+
1291
+ **Answer**
1292
+
1293
+ | Name | Type | Required | What it is |
1294
+ | --- | --- | --- | --- |
1295
+ | `master_tracking_number` | string | | |
1296
+ | `tracking_numbers` | string[] | yes | |
1297
+ | `label_urls` | string[] | yes | |
1298
+
1299
+ ### fedex_rate (workflow step)
1300
+
1301
+ - Get FedEx rate quotes for a shipment.
1302
+ - Returns one priced row per available service (or just the requested service_type).
1303
+ - Use before booking to compare costs.
1304
+
1305
+ **Inputs**
1306
+
1307
+ | Name | Type | Required | What it is |
1308
+ | --- | --- | --- | --- |
1309
+ | `connected_account_id` | string | yes | FedEx connected account |
1310
+ | `shipper` | object | yes | |
1311
+ | `shipper.postal_code` | string | yes | |
1312
+ | `shipper.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1313
+ | `shipper.city` | string | | |
1314
+ | `shipper.state_or_province_code` | string | | |
1315
+ | `shipper.street_lines` | string[] | | |
1316
+ | `shipper.residential` | boolean | | |
1317
+ | `recipient` | object | yes | |
1318
+ | `recipient.postal_code` | string | yes | |
1319
+ | `recipient.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1320
+ | `recipient.city` | string | | |
1321
+ | `recipient.state_or_province_code` | string | | |
1322
+ | `recipient.street_lines` | string[] | | |
1323
+ | `recipient.residential` | boolean | | |
1324
+ | `packages` | object[] | yes | One entry per package; weight in kg |
1325
+ | `packages[].weight` | number | yes | |
1326
+ | `packages[].weight_units` | "KG" \\| "LB" | | Weight units; FedEx requires LB for US domestic express |
1327
+ | `packages[].length` | number | | |
1328
+ | `packages[].width` | number | | |
1329
+ | `packages[].height` | number | | |
1330
+ | `packages[].dimension_units` | "CM" \\| "IN" | | |
1331
+ | `service_type` | string | | FedEx service type e.g. INTERNATIONAL_PRIORITY. Omit to rate all available services. |
1332
+ | `packaging_type` | string | | FedEx packaging type e.g. YOUR_PACKAGING |
1333
+ | `pickup_type` | string | | FedEx pickup type e.g. USE_SCHEDULED_PICKUP |
1334
+ | `ship_datestamp` | string | | Ship date YYYY-MM-DD |
1335
+ | `special_services` | string[] | | FedEx special service types e.g. SATURDAY_DELIVERY |
1336
+
1337
+ **Answer**
1338
+
1339
+ | Name | Type | Required | What it is |
1340
+ | --- | --- | --- | --- |
1341
+ | `services` | object[] | yes | |
1342
+ | `services[].service_type` | string | yes | |
1343
+ | `services[].service_name` | string | | |
1344
+ | `services[].total_charge` | number | | |
1345
+ | `services[].currency` | string | | |
1346
+
1347
+ ### fedex_service_availability (workflow step)
1348
+
1349
+ - Check what FedEx services serve a lane. query "transit_times" returns delivery commitments per service; "package_and_service_options" returns valid service/packaging combinations; "special_service_options" returns available special services.
1350
+ - Use before rating/booking to learn the valid service types for an origin → destination.
1351
+
1352
+ **Inputs**
1353
+
1354
+ | Name | Type | Required | What it is |
1355
+ | --- | --- | --- | --- |
1356
+ | `connected_account_id` | string | yes | FedEx connected account |
1357
+ | `query` | "transit_times" \\| "special_service_options" \\| "package_and_service_options" | yes | |
1358
+ | `shipper` | object | yes | |
1359
+ | `shipper.postal_code` | string | yes | |
1360
+ | `shipper.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1361
+ | `shipper.city` | string | | |
1362
+ | `shipper.state_or_province_code` | string | | |
1363
+ | `shipper.street_lines` | string[] | | |
1364
+ | `shipper.residential` | boolean | | |
1365
+ | `recipient` | object | yes | |
1366
+ | `recipient.postal_code` | string | yes | |
1367
+ | `recipient.country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1368
+ | `recipient.city` | string | | |
1369
+ | `recipient.state_or_province_code` | string | | |
1370
+ | `recipient.street_lines` | string[] | | |
1371
+ | `recipient.residential` | boolean | | |
1372
+ | `packages` | object[] | yes | One entry per package; weight in kg unless weight_units set |
1373
+ | `packages[].weight` | number | yes | |
1374
+ | `packages[].weight_units` | "KG" \\| "LB" | | Weight units; FedEx requires LB for US domestic express |
1375
+ | `packages[].length` | number | | |
1376
+ | `packages[].width` | number | | |
1377
+ | `packages[].height` | number | | |
1378
+ | `packages[].dimension_units` | "CM" \\| "IN" | | |
1379
+ | `ship_datestamp` | string | | Ship date YYYY-MM-DD |
1380
+ | `carrier_codes` | string[] | yes | FedEx carrier codes — at least one, e.g. FDXE (Express), FDXG (Ground) |
1381
+
1382
+ **Answer**
1383
+
1384
+ | Name | Type | Required | What it is |
1385
+ | --- | --- | --- | --- |
1386
+ | `result` | object | yes | |
1387
+
1388
+ ### fedex_validate_address (workflow step)
1389
+
1390
+ - Validate one or more addresses with FedEx.
1391
+ - Returns each resolved address plus its classification (e.g.
1392
+ - BUSINESS / RESIDENTIAL) and deliverability attributes.
1393
+
1394
+ **Inputs**
1395
+
1396
+ | Name | Type | Required | What it is |
1397
+ | --- | --- | --- | --- |
1398
+ | `connected_account_id` | string | yes | FedEx connected account |
1399
+ | `addresses` | object[] | yes | |
1400
+ | `addresses[].postal_code` | string | yes | |
1401
+ | `addresses[].country_code` | string | yes | ISO 3166-1 alpha-2 country code, e.g. VN, US, SG |
1402
+ | `addresses[].city` | string | | |
1403
+ | `addresses[].state_or_province_code` | string | | |
1404
+ | `addresses[].street_lines` | string[] | | |
1405
+ | `addresses[].residential` | boolean | | |
1406
+
1407
+ **Answer**
1408
+
1409
+ | Name | Type | Required | What it is |
1410
+ | --- | --- | --- | --- |
1411
+ | `resolved_addresses` | object[] | yes | |
1412
+ | `resolved_addresses[].city` | string | | |
1413
+ | `resolved_addresses[].state_or_province_code` | string | | |
1414
+ | `resolved_addresses[].postal_code` | string | | |
1415
+ | `resolved_addresses[].country_code` | string | | |
1416
+ | `resolved_addresses[].classification` | string | | |
1417
+ | `resolved_addresses[].attributes` | object | | |
1418
+
1419
+ ## generate
1420
+
1421
+ ### generate_bank_qr_code (workflow step)
1422
+
1423
+ - Generate a bank-payment QR code (VietQR for Vietnam) and save it as a PNG to the workspace.
1424
+ - The QR encodes the recipient bank, account number, and optional amount/description so any banking app can scan and pre-fill the transfer.
1425
+ - Call list_banks first to discover valid bank codes. (workflow step, chat)
1426
+
1427
+ **Inputs**
1428
+
1429
+ | Name | Type | Required | What it is |
1430
+ | --- | --- | --- | --- |
1431
+ | `country` | "VN" | yes | Country whose bank-payment QR standard to use. Currently only 'VN' (Vietnam / VietQR) is supported. |
1432
+ | `bank_code` | "ICB" \\| "VCB" \\| "BIDV" \\| "VBA" \\| "OCB" \\| "MB" \\| "TCB" \\| "ACB" \\| "VPB" \\| "TPB" \\| "STB" \\| "HDB" \\| "VCCB" \\| "SCB" \\| "VIB" \\| "SHB" \\| "EIB" \\| "MSB" \\| "CAKE" \\| "Ubank" \\| "TIMO" \\| "SGICB" \\| "BAB" \\| "momo" \\| "PVDB" \\| "PVCB" \\| "MBV" \\| "NCB" \\| "SHBVN" \\| "ABB" \\| "VAB" \\| "NAB" \\| "PGB" \\| "VIETBANK" \\| "BVB" \\| "SEAB" \\| "COOPBANK" \\| "LPB" \\| "KLB" \\| "KBank" \\| "CIMB" \\| "WVN" | yes | Bank code from list_banks. Must belong to the specified country. (workflow step, chat) |
1433
+ | `account_number` | string | yes | Beneficiary account number at the bank. |
1434
+ | `amount` | number | | Payment amount in the local currency (VND for Vietnam). Omit for a static QR with no fixed amount. |
1435
+ | `description` | string | | Transfer description / memo. Max 50 bytes; Vietnamese diacritics use 2–3 bytes per character. |
1436
+ | `account_name` | string | | Beneficiary name shown on the payer's banking app confirmation screen. Max 25 bytes — banks normalize Vietnamese names to ASCII uppercase, pass the normalized form (e.g. 'NGUYEN VAN A'). |
1437
+ | `filename` | string | | Output filename. Defaults to 'bank_qr_<bank_code>.png'. |
1438
+
1439
+ **Answer**
1440
+
1441
+ | Name | Type | Required | What it is |
1442
+ | --- | --- | --- | --- |
1443
+ | `id` | string | yes | |
1444
+ | `filename` | string | yes | |
1445
+ | `mime_type` | string | yes | |
1446
+ | `url` | string | yes | |
1447
+ | `bank` | object | yes | |
1448
+ | `bank.country` | string | yes | |
1449
+ | `bank.code` | string | yes | |
1450
+ | `bank.short_name` | string | yes | |
1451
+ | `bank.full_name` | string | yes | |
1452
+
1453
+ ### generate_image (workflow step)
1454
+
1455
+ - Generate an image from a text prompt and save it to the workspace.
1456
+ - Returns a file_id usable as an image field value or attachment.
1457
+
1458
+ **Inputs**
1459
+
1460
+ | Name | Type | Required | What it is |
1461
+ | --- | --- | --- | --- |
1462
+ | `prompt` | string | yes | Description of the image to generate. |
1463
+ | `size` | "1024x1024" \\| "1024x1536" \\| "1536x1024" | | Square, portrait, or landscape. |
1464
+ | `quality` | "low" \\| "medium" \\| "high" | | Higher quality costs more. |
1465
+
1466
+ **Answer**
1467
+
1468
+ | Name | Type | Required | What it is |
1469
+ | --- | --- | --- | --- |
1470
+ | `file_id` | string | yes | |
1471
+ | `url` | string | yes | |
1472
+ | `width` | number | yes | |
1473
+ | `height` | number | yes | |
1474
+ | `mime_type` | string | yes | |
1475
+
1476
+ ### generate_qr_code (workflow step)
1477
+
1478
+ - Generate a QR code PNG from text or a URL and save it to the workspace.
1479
+ - For bank payment QR codes, use generate_bank_qr_code instead — it builds the correct EMVCo payload from a bank code and account number. (workflow step, chat)
1480
+
1481
+ **Inputs**
1482
+
1483
+ | Name | Type | Required | What it is |
1484
+ | --- | --- | --- | --- |
1485
+ | `data` | string | yes | Text or URL to encode into the QR code. |
1486
+ | `filename` | string | | Output filename. Defaults to 'qr_code.png'. |
1487
+
1488
+ **Answer**
1489
+
1490
+ | Name | Type | Required | What it is |
1491
+ | --- | --- | --- | --- |
1492
+ | `id` | string | yes | |
1493
+ | `filename` | string | yes | |
1494
+ | `mime_type` | string | yes | |
1495
+ | `url` | string | yes | |
1496
+
1497
+ ## gmail
1498
+
1499
+ ### gmail_get_thread (workflow step)
1500
+
1501
+ - Retrieve all messages in a Gmail thread.
1502
+
1503
+ **Inputs**
1504
+
1505
+ | Name | Type | Required | What it is |
1506
+ | --- | --- | --- | --- |
1507
+ | `connected_account_id` | string | yes | The ID of the connected Gmail account to use |
1508
+ | `thread_id` | string | yes | Gmail thread ID |
1509
+
1510
+ **Answer**
1511
+
1512
+ | Name | Type | Required | What it is |
1513
+ | --- | --- | --- | --- |
1514
+ | `messages` | object[] | yes | |
1515
+ | `messages[].id` | string | yes | Gmail message ID |
1516
+ | `messages[].threadId` | string | yes | Gmail thread ID |
1517
+ | `messages[].labelIds` | string[] | yes | Gmail label IDs (e.g. INBOX, UNREAD) |
1518
+ | `messages[].subject` | string | yes | Email subject |
1519
+ | `messages[].from` | string | yes | Sender email address |
1520
+ | `messages[].to` | string | yes | Recipient email address |
1521
+ | `messages[].date` | string | yes | Email date in the workspace timezone, with its offset |
1522
+ | `messages[].snippet` | string | yes | Short plain-text preview of the email body |
1523
+ | `messages[].cc` | string \\| null | | CC recipients |
1524
+ | `messages[].bcc` | string \\| null | | BCC recipients |
1525
+
1526
+ ### gmail_query_emails (workflow step)
1527
+
1528
+ - Search Gmail messages using Gmail search syntax. ## Query syntax Operators (no space after colon): - People: from:, to:, cc:, bcc:, deliveredto: - Content: subject:, "exact phrase", +exact_word, AROUND N (proximity) - Status: is:unread, is:read, is:starred, is:important, is:muted - Labels: label:name, in:inbox, in:sent, in:drafts, in:spam, in:trash, in:anywhere - Category: category:primary, category:social, category:promotions, category:updates, category:forums - Attachments: has:attachment, has:drive, filename:pdf, filename:report.xlsx (has:attachment matches non-inline attachments only — it misses inline-embedded PDFs, common in receipts/invoices; open the message with gmail_read_email to detect those) - Size: larger:5M, smaller:2M, size:1000000 - Dates (YYYY/MM/DD): after:2024/01/01, before:2024/12/31 - Relative dates: newer_than:7d, older_than:3m, newer_than:1y (d=days, m=months, y=years) Combining: space = AND, OR (uppercase), - (exclude), () for grouping, {} alternative OR syntax. (workflow step, chat)
1529
+ - Examples: - from:alice is:unread has:attachment - subject:"quarterly review" newer_than:2d - {from:alice from:bob} subject:project -in:drafts - larger:5M filename:pdf older_than:6m - in:anywhere deliveredto:billing@company.com
1530
+
1531
+ **Inputs**
1532
+
1533
+ | Name | Type | Required | What it is |
1534
+ | --- | --- | --- | --- |
1535
+ | `connected_account_id` | string | yes | The ID of the connected Gmail account to use |
1536
+ | `query` | string | yes | Gmail search syntax expression |
1537
+ | `max_result` | number | yes | Maximum number of emails to retrieve (1-50) |
1538
+
1539
+ **Answer**
1540
+
1541
+ | Name | Type | Required | What it is |
1542
+ | --- | --- | --- | --- |
1543
+ | `messages` | object[] | yes | List of matching Gmail messages |
1544
+ | `messages[].id` | string | yes | Gmail message ID |
1545
+ | `messages[].threadId` | string | yes | Gmail thread ID |
1546
+ | `messages[].labelIds` | string[] | yes | Gmail label IDs (e.g. INBOX, UNREAD) |
1547
+ | `messages[].subject` | string | yes | Email subject |
1548
+ | `messages[].from` | string | yes | Sender email address |
1549
+ | `messages[].to` | string | yes | Recipient email address |
1550
+ | `messages[].date` | string | yes | Email date in the workspace timezone, with its offset |
1551
+ | `messages[].snippet` | string | yes | Short plain-text preview of the email body |
1552
+ | `messages[].cc` | string \\| null | | CC recipients |
1553
+ | `messages[].bcc` | string \\| null | | BCC recipients |
1554
+
1555
+ ### gmail_query_labels (workflow step)
1556
+
1557
+ - List Gmail labels with message and thread counts.
1558
+
1559
+ **Inputs**
1560
+
1561
+ | Name | Type | Required | What it is |
1562
+ | --- | --- | --- | --- |
1563
+ | `connected_account_id` | string | yes | The ID of the connected Gmail account to use |
1564
+ | `name` | string | | Match labels by name prefix. |
1565
+
1566
+ **Answer**
1567
+
1568
+ | Name | Type | Required | What it is |
1569
+ | --- | --- | --- | --- |
1570
+ | `labels` | object[] | yes | |
1571
+ | `labels[].id` | string | yes | |
1572
+ | `labels[].name` | string | yes | |
1573
+ | `labels[].type` | string | yes | system or user |
1574
+ | `labels[].messagesTotal` | number | yes | |
1575
+ | `labels[].messagesUnread` | number | yes | |
1576
+ | `labels[].threadsTotal` | number | yes | |
1577
+ | `labels[].threadsUnread` | number | yes | |
1578
+
1579
+ ### gmail_read_email (workflow step)
1580
+
1581
+ - Fetch a Gmail message's body and the list of its attachments.
1582
+ - Attachments are stored as workspace files — the result names each one's file_id; read one with view_files, attach one to a record with update_records. (workflow step, chat)
1583
+
1584
+ **Inputs**
1585
+
1586
+ | Name | Type | Required | What it is |
1587
+ | --- | --- | --- | --- |
1588
+ | `connected_account_id` | string | yes | The ID of the connected account |
1589
+ | `message_id` | string | yes | The ID of the Gmail message to retrieve |
1590
+
1591
+ **Answer**
1592
+
1593
+ | Name | Type | Required | What it is |
1594
+ | --- | --- | --- | --- |
1595
+ | `message` | object | yes | The full Gmail message |
1596
+ | `message.id` | string | | Gmail message ID |
1597
+ | `message.threadId` | string | | Gmail thread ID |
1598
+ | `message.historyId` | string | | Gmail history ID |
1599
+ | `message.labelIds` | string[] | | Gmail label IDs |
1600
+ | `message.subject` | string | yes | Email subject |
1601
+ | `message.from` | string | yes | Sender email address |
1602
+ | `message.to` | string | yes | Recipient email address |
1603
+ | `message.date` | string | yes | Email date in the workspace timezone, with its offset |
1604
+ | `message.body` | object | yes | Email body |
1605
+ | `message.body.type` | "text" \\| "html" | yes | Body content type |
1606
+ | `message.body.content` | string | yes | Body content |
1607
+ | `message.cc` | string \\| null | | CC recipients |
1608
+ | `message.bcc` | string \\| null | | BCC recipients |
1609
+ | `message.inReplyTo` | string \\| null | | In-Reply-To header |
1610
+ | `message.replyTo` | string \\| null | | Reply-To header |
1611
+ | `message.references` | string[] \\| null | | References header |
1612
+ | `message.attachments` | object[] | yes | Email attachments |
1613
+ | `message.attachments[].partId` | string | yes | MIME part ID |
1614
+ | `message.attachments[].filename` | string | yes | Attachment filename as stored, which may differ from the sender's |
1615
+ | `message.attachments[].mimeType` | string | yes | MIME type as stored, recovered from the filename when the sender declared a generic one |
1616
+ | `message.attachments[].attachmentId` | string | yes | Gmail attachment ID |
1617
+ | `message.attachments[].file_id` | string | | Stored file ID — pass to view_files to read it, or to update_records to attach it (workflow step, chat) |
1618
+ | `message.attachments[].size` | number | | Stored size in bytes |
1619
+
1620
+ ### gmail_reply_email (workflow step)
1621
+
1622
+ - Draft or send a reply to a Gmail message.
1623
+ - Use reply_body (markdown) or template_id + template_data — not both.
1624
+ - Attach stored files by passing their file_ids.
1625
+ - Leaves an unsent draft unless draft is false.
1626
+
1627
+ **Inputs**
1628
+
1629
+ | Name | Type | Required | What it is |
1630
+ | --- | --- | --- | --- |
1631
+ | `connected_account_id` | string | yes | |
1632
+ | `original_message_id` | string | yes | |
1633
+ | `reply_body` | string | | Reply body (markdown). Mutually exclusive with template_id. |
1634
+ | `template_id` | string | | |
1635
+ | `template_data` | object | | |
1636
+ | `cc` | string | | CC recipients, comma-separated |
1637
+ | `bcc` | string | | BCC recipients, comma-separated |
1638
+ | `draft` | boolean | | Leave true to save an unsent draft the member reviews. Pass false only to deliver the message now — delivery is irreversible. |
1639
+ | `file_ids` | string[] | yes | |
1640
+
1641
+ **Answer**
1642
+
1643
+ | Name | Type | Required | What it is |
1644
+ | --- | --- | --- | --- |
1645
+ | `message_id` | string | yes | The ID of the sent message or saved draft |
1646
+ | `subject` | string | yes | The subject as sent |
1647
+ | `html` | string | yes | The body as sent, rendered to HTML |
1648
+ | `markdown` | string | | The body as written in markdown; absent when a template rendered it |
1649
+ | `to` | string | yes | The original sender the reply went to |
1650
+
1651
+ ### gmail_send_email (workflow step)
1652
+
1653
+ - Draft or send a Gmail email.
1654
+ - Use content (markdown) or template_id + template_data — not both.
1655
+ - Attach stored files by passing their file_ids.
1656
+ - Leaves an unsent draft unless draft is false.
1657
+
1658
+ **Inputs**
1659
+
1660
+ | Name | Type | Required | What it is |
1661
+ | --- | --- | --- | --- |
1662
+ | `connected_account_id` | string | yes | |
1663
+ | `to` | string | | Recipient email(s), comma-separated. Required unless using a template. |
1664
+ | `subject` | string | | |
1665
+ | `cc` | string | | CC recipients, comma-separated |
1666
+ | `bcc` | string | | BCC recipients, comma-separated |
1667
+ | `content` | string | | Email body (markdown). Mutually exclusive with template_id. |
1668
+ | `template_id` | string | | |
1669
+ | `template_data` | object | | |
1670
+ | `draft` | boolean | | Leave true to save an unsent draft the member reviews. Pass false only to deliver the message now — delivery is irreversible. |
1671
+ | `file_ids` | string[] | yes | |
1672
+
1673
+ **Answer**
1674
+
1675
+ | Name | Type | Required | What it is |
1676
+ | --- | --- | --- | --- |
1677
+ | `message_id` | string | yes | The ID of the sent message or saved draft |
1678
+ | `subject` | string | yes | The subject as sent |
1679
+ | `html` | string | yes | The body as sent, rendered to HTML |
1680
+ | `markdown` | string | | The body as written in markdown; absent when a template rendered it |
1681
+ | `to` | string | yes | The recipients as sent, comma-separated |
1682
+
1683
+ ## instagram
1684
+
1685
+ ### instagram_create_post (workflow step)
1686
+
1687
+ - Publish to the connected Instagram account.
1688
+ - Instagram has no text-only posts.
1689
+
1690
+ **Inputs**
1691
+
1692
+ | Name | Type | Required | What it is |
1693
+ | --- | --- | --- | --- |
1694
+ | `connected_account_id` | string | yes | |
1695
+ | `caption` | string | yes | |
1696
+ | `media_file_ids` | string[] | yes | One image, one video (published as a reel), or 2–10 images and videos as a carousel. |
1697
+
1698
+ **Answer**
1699
+
1700
+ | Name | Type | Required | What it is |
1701
+ | --- | --- | --- | --- |
1702
+ | `post_id` | string | yes | |
1703
+ | `url` | string | yes | |
1704
+
1705
+ ## kiotviet
1706
+
1707
+ ### kiotviet_cancel_invoice (workflow step)
1708
+
1709
+ - Cancel a KiotViet sales invoice by id, returning its stock.
1710
+
1711
+ **Inputs**
1712
+
1713
+ | Name | Type | Required | What it is |
1714
+ | --- | --- | --- | --- |
1715
+ | `connected_account_id` | string | yes | KiotViet connected account |
1716
+ | `id` | number | yes | |
1717
+ | `void_payment` | boolean | | Also void payments recorded on the invoice |
1718
+
1719
+ **Answer**
1720
+
1721
+ | Name | Type | Required | What it is |
1722
+ | --- | --- | --- | --- |
1723
+ | `cancelled` | true | yes | |
1724
+
1725
+ ### kiotviet_cancel_order (workflow step)
1726
+
1727
+ - Cancel a KiotViet sales order by id, releasing the stock it reserved.
1728
+
1729
+ **Inputs**
1730
+
1731
+ | Name | Type | Required | What it is |
1732
+ | --- | --- | --- | --- |
1733
+ | `connected_account_id` | string | yes | KiotViet connected account |
1734
+ | `id` | number | yes | |
1735
+ | `void_payment` | boolean | | Also void payments recorded on the order |
1736
+
1737
+ **Answer**
1738
+
1739
+ | Name | Type | Required | What it is |
1740
+ | --- | --- | --- | --- |
1741
+ | `cancelled` | true | yes | |
1742
+
1743
+ ### kiotviet_create_category (workflow step)
1744
+
1745
+ - Create a KiotViet product group (nhóm hàng), optionally under a parent group.
1746
+
1747
+ **Inputs**
1748
+
1749
+ | Name | Type | Required | What it is |
1750
+ | --- | --- | --- | --- |
1751
+ | `connected_account_id` | string | yes | KiotViet connected account |
1752
+ | `name` | string | yes | |
1753
+ | `parent_id` | number | | |
1754
+
1755
+ **Answer**
1756
+
1757
+ | Name | Type | Required | What it is |
1758
+ | --- | --- | --- | --- |
1759
+ | `category` | object | yes | |
1760
+
1761
+ ### kiotviet_create_customer (workflow step)
1762
+
1763
+ - Create a KiotViet customer (khách hàng).
1764
+ - Returns the customer as KiotViet stores it, with its id and code.
1765
+
1766
+ **Inputs**
1767
+
1768
+ | Name | Type | Required | What it is |
1769
+ | --- | --- | --- | --- |
1770
+ | `connected_account_id` | string | yes | KiotViet connected account |
1771
+ | `name` | string | yes | |
1772
+ | `code` | string | | Customer code (mã khách hàng) |
1773
+ | `contact_number` | string | | |
1774
+ | `email` | string | | |
1775
+ | `address` | string | | |
1776
+ | `location_name` | string | | Province/district as KiotViet names it |
1777
+ | `ward_name` | string | | |
1778
+ | `gender` | boolean | | true for male, false for female |
1779
+ | `birth_date` | string | | yyyy-mm-dd |
1780
+ | `group_ids` | number[] | | Customer group ids |
1781
+ | `comments` | string | | |
1782
+ | `branch_id` | number | | |
1783
+
1784
+ **Answer**
1785
+
1786
+ | Name | Type | Required | What it is |
1787
+ | --- | --- | --- | --- |
1788
+ | `customer` | object | yes | |
1789
+
1790
+ ### kiotviet_create_invoice (workflow step)
1791
+
1792
+ - Create a KiotViet sales invoice (hóa đơn), which deducts stock.
1793
+ - Pass order_id to invoice an existing order.
1794
+ - Returns the invoice as KiotViet stores it, with its id and code.
1795
+
1796
+ **Inputs**
1797
+
1798
+ | Name | Type | Required | What it is |
1799
+ | --- | --- | --- | --- |
1800
+ | `connected_account_id` | string | yes | KiotViet connected account |
1801
+ | `branch_id` | number | yes | |
1802
+ | `customer_id` | number | | |
1803
+ | `sold_by_id` | number | yes | KiotViet user id of the seller |
1804
+ | `purchase_date` | string | | ISO datetime |
1805
+ | `description` | string | | |
1806
+ | `discount` | number | | Discount amount on the whole document |
1807
+ | `lines` | object[] | yes | |
1808
+ | `lines[].product_id` | number | yes | |
1809
+ | `lines[].quantity` | number | yes | |
1810
+ | `lines[].price` | number | | Unit price |
1811
+ | `lines[].discount` | number | | Discount amount on the line |
1812
+ | `lines[].note` | string | | |
1813
+ | `order_id` | number | | The sales order this invoice settles |
1814
+
1815
+ **Answer**
1816
+
1817
+ | Name | Type | Required | What it is |
1818
+ | --- | --- | --- | --- |
1819
+ | `invoice` | object | yes | |
1820
+
1821
+ ### kiotviet_create_order (workflow step)
1822
+
1823
+ - Create a KiotViet sales order (đặt hàng) — the pre-invoice stage, which reserves stock.
1824
+ - Returns the order as KiotViet stores it, with its id and code.
1825
+
1826
+ **Inputs**
1827
+
1828
+ | Name | Type | Required | What it is |
1829
+ | --- | --- | --- | --- |
1830
+ | `connected_account_id` | string | yes | KiotViet connected account |
1831
+ | `branch_id` | number | yes | |
1832
+ | `customer_id` | number | | |
1833
+ | `sold_by_id` | number | | KiotViet user id of the seller |
1834
+ | `purchase_date` | string | | ISO datetime |
1835
+ | `description` | string | | |
1836
+ | `discount` | number | | Discount amount on the whole document |
1837
+ | `lines` | object[] | yes | |
1838
+ | `lines[].product_id` | number | yes | |
1839
+ | `lines[].quantity` | number | yes | |
1840
+ | `lines[].price` | number | | Unit price |
1841
+ | `lines[].discount` | number | | Discount amount on the line |
1842
+ | `lines[].note` | string | | |
1843
+ | `make_invoice` | boolean | | Also issue the invoice at once |
1844
+
1845
+ **Answer**
1846
+
1847
+ | Name | Type | Required | What it is |
1848
+ | --- | --- | --- | --- |
1849
+ | `order` | object | yes | |
1850
+
1851
+ ### kiotviet_create_product (workflow step)
1852
+
1853
+ - Create a KiotViet product (hàng hóa), optionally with opening stock per branch.
1854
+ - Returns the product as KiotViet stores it, with its id and code.
1855
+
1856
+ **Inputs**
1857
+
1858
+ | Name | Type | Required | What it is |
1859
+ | --- | --- | --- | --- |
1860
+ | `connected_account_id` | string | yes | KiotViet connected account |
1861
+ | `name` | string | yes | |
1862
+ | `code` | string | | Product code (mã hàng) |
1863
+ | `category_id` | number | yes | Product group id |
1864
+ | `base_price` | number | | Selling price |
1865
+ | `unit` | string | | |
1866
+ | `allows_sale` | boolean | | |
1867
+ | `is_active` | boolean | | |
1868
+ | `description` | string | | |
1869
+ | `weight` | number | | Grams |
1870
+ | `inventories` | object[] | | Stock per branch |
1871
+ | `inventories[].branch_id` | number | yes | |
1872
+ | `inventories[].on_hand` | number | yes | |
1873
+ | `inventories[].cost` | number | | Unit cost at this branch |
1874
+
1875
+ **Answer**
1876
+
1877
+ | Name | Type | Required | What it is |
1878
+ | --- | --- | --- | --- |
1879
+ | `product` | object | yes | |
1880
+
1881
+ ### kiotviet_delete_product (workflow step)
1882
+
1883
+ - Delete a KiotViet product by id.
1884
+ - KiotViet refuses one that already appears on invoices.
1885
+
1886
+ **Inputs**
1887
+
1888
+ | Name | Type | Required | What it is |
1889
+ | --- | --- | --- | --- |
1890
+ | `connected_account_id` | string | yes | KiotViet connected account |
1891
+ | `id` | number | yes | |
1892
+
1893
+ **Answer**
1894
+
1895
+ | Name | Type | Required | What it is |
1896
+ | --- | --- | --- | --- |
1897
+ | `deleted` | true | yes | |
1898
+
1899
+ ### kiotviet_get_customer (workflow step)
1900
+
1901
+ - Get one KiotViet customer by id or by customer code (mã khách hàng).
1902
+
1903
+ **Inputs**
1904
+
1905
+ | Name | Type | Required | What it is |
1906
+ | --- | --- | --- | --- |
1907
+ | `connected_account_id` | string | yes | KiotViet connected account |
1908
+ | `id` | number | | |
1909
+ | `code` | string | | Customer code (mã khách hàng), e.g. KH000123 |
1910
+
1911
+ **Answer**
1912
+
1913
+ | Name | Type | Required | What it is |
1914
+ | --- | --- | --- | --- |
1915
+ | `customer` | object | yes | |
1916
+
1917
+ ### kiotviet_get_invoice (workflow step)
1918
+
1919
+ - Get one KiotViet sales invoice by id or by invoice code (mã hóa đơn), with its line items and payments.
1920
+
1921
+ **Inputs**
1922
+
1923
+ | Name | Type | Required | What it is |
1924
+ | --- | --- | --- | --- |
1925
+ | `connected_account_id` | string | yes | KiotViet connected account |
1926
+ | `id` | number | | |
1927
+ | `code` | string | | Invoice code (mã hóa đơn), e.g. HD000123 |
1928
+
1929
+ **Answer**
1930
+
1931
+ | Name | Type | Required | What it is |
1932
+ | --- | --- | --- | --- |
1933
+ | `invoice` | object | yes | |
1934
+
1935
+ ### kiotviet_get_product (workflow step)
1936
+
1937
+ - Get one KiotViet product by id or by product code (mã hàng), with stock per branch in inventories[].
1938
+
1939
+ **Inputs**
1940
+
1941
+ | Name | Type | Required | What it is |
1942
+ | --- | --- | --- | --- |
1943
+ | `connected_account_id` | string | yes | KiotViet connected account |
1944
+ | `id` | number | | |
1945
+ | `code` | string | | Product code (mã hàng), e.g. SP000123 |
1946
+
1947
+ **Answer**
1948
+
1949
+ | Name | Type | Required | What it is |
1950
+ | --- | --- | --- | --- |
1951
+ | `product` | object | yes | |
1952
+
1953
+ ### kiotviet_list_branches (workflow step)
1954
+
1955
+ - List the store's KiotViet branches (chi nhánh).
1956
+ - Branch ids scope inventory, invoices and orders.
1957
+
1958
+ **Inputs**
1959
+
1960
+ | Name | Type | Required | What it is |
1961
+ | --- | --- | --- | --- |
1962
+ | `connected_account_id` | string | yes | KiotViet connected account |
1963
+ | `page_size` | number | | Rows per page, up to 100 |
1964
+ | `current_item` | number | | Zero-based offset of the first row |
1965
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
1966
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
1967
+ | `order_by` | string | | KiotViet field name to sort by |
1968
+ | `order_direction` | "Asc" \\| "Desc" | | |
1969
+
1970
+ **Answer**
1971
+
1972
+ | Name | Type | Required | What it is |
1973
+ | --- | --- | --- | --- |
1974
+ | `total` | number | | Rows matching the query across all pages |
1975
+ | `page_size` | number | | |
1976
+ | `items` | object[] | yes | Rows as KiotViet returns them |
1977
+ | `removed_ids` | number[] | | |
1978
+
1979
+ ### kiotviet_list_categories (workflow step)
1980
+
1981
+ - List KiotViet product groups (nhóm hàng).
1982
+ - Each row carries its parentId, so the tree can be rebuilt from the flat list.
1983
+
1984
+ **Inputs**
1985
+
1986
+ | Name | Type | Required | What it is |
1987
+ | --- | --- | --- | --- |
1988
+ | `connected_account_id` | string | yes | KiotViet connected account |
1989
+ | `page_size` | number | | Rows per page, up to 100 |
1990
+ | `current_item` | number | | Zero-based offset of the first row |
1991
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
1992
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
1993
+ | `order_by` | string | | KiotViet field name to sort by |
1994
+ | `order_direction` | "Asc" \\| "Desc" | | |
1995
+
1996
+ **Answer**
1997
+
1998
+ | Name | Type | Required | What it is |
1999
+ | --- | --- | --- | --- |
2000
+ | `total` | number | | Rows matching the query across all pages |
2001
+ | `page_size` | number | | |
2002
+ | `items` | object[] | yes | Rows as KiotViet returns them |
2003
+ | `removed_ids` | number[] | | |
2004
+
2005
+ ### kiotviet_list_customers (workflow step)
2006
+
2007
+ - List KiotViet customers (khách hàng) with their lifetime totals — totalInvoiced, totalRevenue, debt, totalPoint.
2008
+
2009
+ **Inputs**
2010
+
2011
+ | Name | Type | Required | What it is |
2012
+ | --- | --- | --- | --- |
2013
+ | `connected_account_id` | string | yes | KiotViet connected account |
2014
+ | `page_size` | number | | Rows per page, up to 100 |
2015
+ | `current_item` | number | | Zero-based offset of the first row |
2016
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
2017
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
2018
+ | `order_by` | string | | KiotViet field name to sort by |
2019
+ | `order_direction` | "Asc" \\| "Desc" | | |
2020
+ | `code` | string | | Customer code (mã khách hàng) |
2021
+ | `name` | string | | Name search |
2022
+ | `contact_number` | string | | Phone number |
2023
+ | `group_id` | number | | Only customers in this customer group |
2024
+
2025
+ **Answer**
2026
+
2027
+ | Name | Type | Required | What it is |
2028
+ | --- | --- | --- | --- |
2029
+ | `total` | number | | Rows matching the query across all pages |
2030
+ | `page_size` | number | | |
2031
+ | `items` | object[] | yes | Rows as KiotViet returns them |
2032
+ | `removed_ids` | number[] | | |
2033
+
2034
+ ### kiotviet_list_invoices (workflow step)
2035
+
2036
+ - List KiotViet sales invoices (hóa đơn) with their line items in invoiceDetails[] — productCode, productName, quantity, price, discount, subTotal.
2037
+
2038
+ **Inputs**
2039
+
2040
+ | Name | Type | Required | What it is |
2041
+ | --- | --- | --- | --- |
2042
+ | `connected_account_id` | string | yes | KiotViet connected account |
2043
+ | `page_size` | number | | Rows per page, up to 100 |
2044
+ | `current_item` | number | | Zero-based offset of the first row |
2045
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
2046
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
2047
+ | `order_by` | string | | KiotViet field name to sort by |
2048
+ | `order_direction` | "Asc" \\| "Desc" | | |
2049
+ | `branch_ids` | number[] | | |
2050
+ | `customer_ids` | number[] | | |
2051
+ | `customer_code` | string | | Customer code (mã khách hàng) |
2052
+ | `status` | number[] | | KiotViet status codes; each row carries statusValue with the label |
2053
+ | `from_purchase_date` | string | | Date, yyyy-mm-dd |
2054
+ | `to_purchase_date` | string | | Date, yyyy-mm-dd |
2055
+ | `include_payment` | boolean | | Include payments[] on each row |
2056
+
2057
+ **Answer**
2058
+
2059
+ | Name | Type | Required | What it is |
2060
+ | --- | --- | --- | --- |
2061
+ | `total` | number | | Rows matching the query across all pages |
2062
+ | `page_size` | number | | |
2063
+ | `items` | object[] | yes | Rows as KiotViet returns them |
2064
+ | `removed_ids` | number[] | | |
2065
+
2066
+ ### kiotviet_list_orders (workflow step)
2067
+
2068
+ - List KiotViet sales orders (đặt hàng) — the pre-invoice stage — with line items in orderDetails[].
2069
+
2070
+ **Inputs**
2071
+
2072
+ | Name | Type | Required | What it is |
2073
+ | --- | --- | --- | --- |
2074
+ | `connected_account_id` | string | yes | KiotViet connected account |
2075
+ | `page_size` | number | | Rows per page, up to 100 |
2076
+ | `current_item` | number | | Zero-based offset of the first row |
2077
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
2078
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
2079
+ | `order_by` | string | | KiotViet field name to sort by |
2080
+ | `order_direction` | "Asc" \\| "Desc" | | |
2081
+ | `branch_ids` | number[] | | |
2082
+ | `customer_ids` | number[] | | |
2083
+ | `customer_code` | string | | Customer code (mã khách hàng) |
2084
+ | `status` | number[] | | KiotViet status codes; each row carries statusValue with the label |
2085
+ | `from_purchase_date` | string | | Date, yyyy-mm-dd |
2086
+ | `to_purchase_date` | string | | Date, yyyy-mm-dd |
2087
+ | `include_payment` | boolean | | Include payments[] on each row |
2088
+
2089
+ **Answer**
2090
+
2091
+ | Name | Type | Required | What it is |
2092
+ | --- | --- | --- | --- |
2093
+ | `total` | number | | Rows matching the query across all pages |
2094
+ | `page_size` | number | | |
2095
+ | `items` | object[] | yes | Rows as KiotViet returns them |
2096
+ | `removed_ids` | number[] | | |
2097
+
2098
+ ### kiotviet_list_products (workflow step)
2099
+
2100
+ - List KiotViet products (hàng hóa) with stock per branch.
2101
+ - Each row's inventories[] carries branchId, onHand (tồn kho), reserved (đặt hàng) and cost.
2102
+
2103
+ **Inputs**
2104
+
2105
+ | Name | Type | Required | What it is |
2106
+ | --- | --- | --- | --- |
2107
+ | `connected_account_id` | string | yes | KiotViet connected account |
2108
+ | `page_size` | number | | Rows per page, up to 100 |
2109
+ | `current_item` | number | | Zero-based offset of the first row |
2110
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
2111
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
2112
+ | `order_by` | string | | KiotViet field name to sort by |
2113
+ | `order_direction` | "Asc" \\| "Desc" | | |
2114
+ | `category_id` | number | | Only products in this product group |
2115
+ | `is_active` | boolean | | Only products still on sale (true) or discontinued (false) |
2116
+
2117
+ **Answer**
2118
+
2119
+ | Name | Type | Required | What it is |
2120
+ | --- | --- | --- | --- |
2121
+ | `total` | number | | Rows matching the query across all pages |
2122
+ | `page_size` | number | | |
2123
+ | `items` | object[] | yes | Rows as KiotViet returns them |
2124
+ | `removed_ids` | number[] | | |
2125
+
2126
+ ### kiotviet_list_purchase_orders (workflow step)
2127
+
2128
+ - List KiotViet purchase orders (phiếu nhập hàng) — goods received from suppliers — with line items in purchaseOrderDetails[].
2129
+
2130
+ **Inputs**
2131
+
2132
+ | Name | Type | Required | What it is |
2133
+ | --- | --- | --- | --- |
2134
+ | `connected_account_id` | string | yes | KiotViet connected account |
2135
+ | `page_size` | number | | Rows per page, up to 100 |
2136
+ | `current_item` | number | | Zero-based offset of the first row |
2137
+ | `last_modified_from` | string | | ISO datetime; only rows modified at or after it |
2138
+ | `include_removed_ids` | boolean | | Also return removed_ids — rows deleted since last_modified_from |
2139
+ | `order_by` | string | | KiotViet field name to sort by |
2140
+ | `order_direction` | "Asc" \\| "Desc" | | |
2141
+ | `branch_ids` | number[] | | |
2142
+ | `status` | number[] | | KiotViet status codes; each row carries statusValue with the label |
2143
+ | `from_purchase_date` | string | | Date, yyyy-mm-dd |
2144
+ | `to_purchase_date` | string | | Date, yyyy-mm-dd |
2145
+ | `include_payment` | boolean | | Include payments[] on each row |
2146
+
2147
+ **Answer**
2148
+
2149
+ | Name | Type | Required | What it is |
2150
+ | --- | --- | --- | --- |
2151
+ | `total` | number | | Rows matching the query across all pages |
2152
+ | `page_size` | number | | |
2153
+ | `items` | object[] | yes | Rows as KiotViet returns them |
2154
+ | `removed_ids` | number[] | | |
2155
+
2156
+ ### kiotviet_update_category (workflow step)
2157
+
2158
+ - Rename a KiotViet product group or move it under another parent.
2159
+
2160
+ **Inputs**
2161
+
2162
+ | Name | Type | Required | What it is |
2163
+ | --- | --- | --- | --- |
2164
+ | `connected_account_id` | string | yes | KiotViet connected account |
2165
+ | `id` | number | yes | |
2166
+ | `name` | string | | |
2167
+ | `parent_id` | number | | |
2168
+
2169
+ **Answer**
2170
+
2171
+ | Name | Type | Required | What it is |
2172
+ | --- | --- | --- | --- |
2173
+ | `category` | object | yes | |
2174
+
2175
+ ### kiotviet_update_customer (workflow step)
2176
+
2177
+ - Update a KiotViet customer by id.
2178
+
2179
+ **Inputs**
2180
+
2181
+ | Name | Type | Required | What it is |
2182
+ | --- | --- | --- | --- |
2183
+ | `connected_account_id` | string | yes | KiotViet connected account |
2184
+ | `id` | number | yes | |
2185
+ | `name` | string | | |
2186
+ | `code` | string | | Customer code (mã khách hàng) |
2187
+ | `contact_number` | string | | |
2188
+ | `email` | string | | |
2189
+ | `address` | string | | |
2190
+ | `location_name` | string | | Province/district as KiotViet names it |
2191
+ | `ward_name` | string | | |
2192
+ | `gender` | boolean | | true for male, false for female |
2193
+ | `birth_date` | string | | yyyy-mm-dd |
2194
+ | `group_ids` | number[] | | Customer group ids |
2195
+ | `comments` | string | | |
2196
+ | `branch_id` | number | | |
2197
+
2198
+ **Answer**
2199
+
2200
+ | Name | Type | Required | What it is |
2201
+ | --- | --- | --- | --- |
2202
+ | `customer` | object | yes | |
2203
+
2204
+ ### kiotviet_update_invoice (workflow step)
2205
+
2206
+ - Update a KiotViet sales invoice by id.
2207
+
2208
+ **Inputs**
2209
+
2210
+ | Name | Type | Required | What it is |
2211
+ | --- | --- | --- | --- |
2212
+ | `connected_account_id` | string | yes | KiotViet connected account |
2213
+ | `id` | number | yes | |
2214
+ | `branch_id` | number | | |
2215
+ | `customer_id` | number | | |
2216
+ | `sold_by_id` | number | | KiotViet user id of the seller |
2217
+ | `purchase_date` | string | | ISO datetime |
2218
+ | `description` | string | | |
2219
+ | `discount` | number | | Discount amount on the whole document |
2220
+ | `lines` | object[] | | |
2221
+ | `lines[].product_id` | number | yes | |
2222
+ | `lines[].quantity` | number | yes | |
2223
+ | `lines[].price` | number | | Unit price |
2224
+ | `lines[].discount` | number | | Discount amount on the line |
2225
+ | `lines[].note` | string | | |
2226
+
2227
+ **Answer**
2228
+
2229
+ | Name | Type | Required | What it is |
2230
+ | --- | --- | --- | --- |
2231
+ | `invoice` | object | yes | |
2232
+
2233
+ ### kiotviet_update_order (workflow step)
2234
+
2235
+ - Update a KiotViet sales order by id.
2236
+
2237
+ **Inputs**
2238
+
2239
+ | Name | Type | Required | What it is |
2240
+ | --- | --- | --- | --- |
2241
+ | `connected_account_id` | string | yes | KiotViet connected account |
2242
+ | `id` | number | yes | |
2243
+ | `branch_id` | number | | |
2244
+ | `customer_id` | number | | |
2245
+ | `sold_by_id` | number | | KiotViet user id of the seller |
2246
+ | `purchase_date` | string | | ISO datetime |
2247
+ | `description` | string | | |
2248
+ | `discount` | number | | Discount amount on the whole document |
2249
+ | `lines` | object[] | | |
2250
+ | `lines[].product_id` | number | yes | |
2251
+ | `lines[].quantity` | number | yes | |
2252
+ | `lines[].price` | number | | Unit price |
2253
+ | `lines[].discount` | number | | Discount amount on the line |
2254
+ | `lines[].note` | string | | |
2255
+
2256
+ **Answer**
2257
+
2258
+ | Name | Type | Required | What it is |
2259
+ | --- | --- | --- | --- |
2260
+ | `order` | object | yes | |
2261
+
2262
+ ### kiotviet_update_product (workflow step)
2263
+
2264
+ - Update a KiotViet product by id; inventories set the stock level per branch.
2265
+
2266
+ **Inputs**
2267
+
2268
+ | Name | Type | Required | What it is |
2269
+ | --- | --- | --- | --- |
2270
+ | `connected_account_id` | string | yes | KiotViet connected account |
2271
+ | `id` | number | yes | |
2272
+ | `name` | string | | |
2273
+ | `code` | string | | Product code (mã hàng) |
2274
+ | `category_id` | number | | Product group id |
2275
+ | `base_price` | number | | Selling price |
2276
+ | `unit` | string | | |
2277
+ | `allows_sale` | boolean | | |
2278
+ | `is_active` | boolean | | |
2279
+ | `description` | string | | |
2280
+ | `weight` | number | | Grams |
2281
+ | `inventories` | object[] | | Stock per branch |
2282
+ | `inventories[].branch_id` | number | yes | |
2283
+ | `inventories[].on_hand` | number | yes | |
2284
+ | `inventories[].cost` | number | | Unit cost at this branch |
2285
+
2286
+ **Answer**
2287
+
2288
+ | Name | Type | Required | What it is |
2289
+ | --- | --- | --- | --- |
2290
+ | `product` | object | yes | |
2291
+
2292
+ ## lark
2293
+
2294
+ ### lark_create_records (workflow step)
2295
+
2296
+ - Create one or many records in a Lark Base (Bitable) table (max 500 per call). fields are keyed by Lark field name.
2297
+ - Returns the new record ids.
2298
+
2299
+ **Inputs**
2300
+
2301
+ | Name | Type | Required | What it is |
2302
+ | --- | --- | --- | --- |
2303
+ | `connected_account_id` | string | yes | Lark connected account |
2304
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2305
+ | `table_id` | string | yes | Lark Bitable table id |
2306
+ | `records` | object[] | yes | |
2307
+ | `records[].fields` | object | yes | |
2308
+
2309
+ **Answer**
2310
+
2311
+ | Name | Type | Required | What it is |
2312
+ | --- | --- | --- | --- |
2313
+ | `created` | number | yes | |
2314
+ | `records` | object[] | yes | |
2315
+ | `records[].record_id` | string | yes | |
2316
+ | `records[].fields` | object | yes | |
2317
+
2318
+ ### lark_delete_records (workflow step)
2319
+
2320
+ - Delete one or many records from a Lark Base (Bitable) table by record_id (max 500 per call).
2321
+
2322
+ **Inputs**
2323
+
2324
+ | Name | Type | Required | What it is |
2325
+ | --- | --- | --- | --- |
2326
+ | `connected_account_id` | string | yes | Lark connected account |
2327
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2328
+ | `table_id` | string | yes | Lark Bitable table id |
2329
+ | `record_ids` | string[] | yes | |
2330
+
2331
+ **Answer**
2332
+
2333
+ | Name | Type | Required | What it is |
2334
+ | --- | --- | --- | --- |
2335
+ | `deleted` | number | yes | |
2336
+ | `record_ids` | string[] | yes | |
2337
+
2338
+ ### lark_get_record (workflow step)
2339
+
2340
+ - Get one record from a Lark Base (Bitable) table by its record_id.
2341
+
2342
+ **Inputs**
2343
+
2344
+ | Name | Type | Required | What it is |
2345
+ | --- | --- | --- | --- |
2346
+ | `connected_account_id` | string | yes | Lark connected account |
2347
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2348
+ | `table_id` | string | yes | Lark Bitable table id |
2349
+ | `record_id` | string | yes | |
2350
+
2351
+ **Answer**
2352
+
2353
+ | Name | Type | Required | What it is |
2354
+ | --- | --- | --- | --- |
2355
+ | `record_id` | string | yes | |
2356
+ | `fields` | object | yes | |
2357
+
2358
+ ### lark_list_fields (workflow step)
2359
+
2360
+ - List the fields (columns) of a Lark Base (Bitable) table — name, id, and type.
2361
+ - Use to discover the schema before reading or writing records.
2362
+
2363
+ **Inputs**
2364
+
2365
+ | Name | Type | Required | What it is |
2366
+ | --- | --- | --- | --- |
2367
+ | `connected_account_id` | string | yes | Lark connected account |
2368
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2369
+ | `table_id` | string | yes | Lark Bitable table id |
2370
+ | `page_size` | number | | |
2371
+ | `page_token` | string | | |
2372
+
2373
+ **Answer**
2374
+
2375
+ | Name | Type | Required | What it is |
2376
+ | --- | --- | --- | --- |
2377
+ | `fields` | object[] | yes | |
2378
+ | `fields[].field_id` | string | | |
2379
+ | `fields[].field_name` | string | | |
2380
+ | `fields[].type` | number | | |
2381
+ | `fields[].ui_type` | string | | |
2382
+ | `fields[].is_primary` | boolean | | |
2383
+ | `has_more` | boolean | yes | |
2384
+ | `page_token` | string | | |
2385
+
2386
+ ### lark_list_records (workflow step)
2387
+
2388
+ - List records from a Lark Base (Bitable) table.
2389
+ - Returns each record's id and fields (keyed by Lark field name).
2390
+ - Optionally narrow with filter / sort / field_names / view_id; paginate with page_token.
2391
+
2392
+ **Inputs**
2393
+
2394
+ | Name | Type | Required | What it is |
2395
+ | --- | --- | --- | --- |
2396
+ | `connected_account_id` | string | yes | Lark connected account |
2397
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2398
+ | `table_id` | string | yes | Lark Bitable table id |
2399
+ | `filter` | object | | |
2400
+ | `filter.conjunction` | "and" \\| "or" | yes | |
2401
+ | `filter.conditions` | object[] | yes | |
2402
+ | `filter.conditions[].field_name` | string | yes | |
2403
+ | `filter.conditions[].operator` | string | yes | e.g. is, isNot, contains, isGreater, isEmpty |
2404
+ | `filter.conditions[].value` | string[] | | |
2405
+ | `sort` | object[] | | |
2406
+ | `sort[].field_name` | string | yes | |
2407
+ | `sort[].desc` | boolean | | |
2408
+ | `field_names` | string[] | | Restrict returned fields by name |
2409
+ | `view_id` | string | | |
2410
+ | `page_size` | number | | |
2411
+ | `page_token` | string | | |
2412
+
2413
+ **Answer**
2414
+
2415
+ | Name | Type | Required | What it is |
2416
+ | --- | --- | --- | --- |
2417
+ | `records` | object[] | yes | |
2418
+ | `records[].record_id` | string | yes | |
2419
+ | `records[].fields` | object | yes | |
2420
+ | `has_more` | boolean | yes | |
2421
+ | `page_token` | string | | |
2422
+ | `total` | number | | |
2423
+
2424
+ ### lark_list_tables (workflow step)
2425
+
2426
+ - List the tables in a Lark Base (Bitable) — id and name.
2427
+ - Use to discover which table_id to read or write.
2428
+
2429
+ **Inputs**
2430
+
2431
+ | Name | Type | Required | What it is |
2432
+ | --- | --- | --- | --- |
2433
+ | `connected_account_id` | string | yes | Lark connected account |
2434
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2435
+ | `page_size` | number | | |
2436
+ | `page_token` | string | | |
2437
+
2438
+ **Answer**
2439
+
2440
+ | Name | Type | Required | What it is |
2441
+ | --- | --- | --- | --- |
2442
+ | `tables` | object[] | yes | |
2443
+ | `tables[].table_id` | string | | |
2444
+ | `tables[].name` | string | | |
2445
+ | `has_more` | boolean | yes | |
2446
+ | `page_token` | string | | |
2447
+
2448
+ ### lark_update_records (workflow step)
2449
+
2450
+ - Update one or many existing records in a Lark Base (Bitable) table by record_id (max 500 per call). fields are keyed by Lark field name; only provided fields change.
2451
+
2452
+ **Inputs**
2453
+
2454
+ | Name | Type | Required | What it is |
2455
+ | --- | --- | --- | --- |
2456
+ | `connected_account_id` | string | yes | Lark connected account |
2457
+ | `app_token` | string | yes | Lark Base app_token (the Base id) |
2458
+ | `table_id` | string | yes | Lark Bitable table id |
2459
+ | `records` | object[] | yes | |
2460
+ | `records[].record_id` | string | yes | |
2461
+ | `records[].fields` | object | yes | |
2462
+
2463
+ **Answer**
2464
+
2465
+ | Name | Type | Required | What it is |
2466
+ | --- | --- | --- | --- |
2467
+ | `updated` | number | yes | |
2468
+ | `records` | object[] | yes | |
2469
+ | `records[].record_id` | string | yes | |
2470
+ | `records[].fields` | object | yes | |
2471
+
2472
+ ## linkedin
2473
+
2474
+ ### linkedin_create_post (workflow step)
2475
+
2476
+ - Publish a post to the connected LinkedIn member's profile.
2477
+
2478
+ **Inputs**
2479
+
2480
+ | Name | Type | Required | What it is |
2481
+ | --- | --- | --- | --- |
2482
+ | `connected_account_id` | string | yes | |
2483
+ | `text` | string | yes | |
2484
+ | `link` | string | | Shown as an article card; needs link_title. A post carries either a link or media. |
2485
+ | `link_title` | string | | |
2486
+ | `media_file_ids` | string[] | | Up to 20 images, or one video. |
2487
+
2488
+ **Answer**
2489
+
2490
+ | Name | Type | Required | What it is |
2491
+ | --- | --- | --- | --- |
2492
+ | `post_id` | string | yes | |
2493
+ | `url` | string | yes | |
2494
+
2495
+ ## list
2496
+
2497
+ ### list_banks (workflow step)
2498
+
2499
+ - List banks supported by generate_bank_qr_code. (workflow step, chat)
2500
+ - Returns the bank code (used as input to the generator), display name, and country.
2501
+ - Call this before generate_bank_qr_code to discover valid codes. (workflow step, chat)
2502
+
2503
+ **Inputs**
2504
+
2505
+ | Name | Type | Required | What it is |
2506
+ | --- | --- | --- | --- |
2507
+ | `country` | "VN" | | Filter to banks from a specific country. Omit to list all supported banks. |
2508
+
2509
+ **Answer**
2510
+
2511
+ | Name | Type | Required | What it is |
2512
+ | --- | --- | --- | --- |
2513
+ | `banks` | object[] | yes | |
2514
+ | `banks[].country` | string | yes | |
2515
+ | `banks[].code` | string | yes | |
2516
+ | `banks[].bin` | string | yes | |
2517
+ | `banks[].short_name` | string | yes | |
2518
+ | `banks[].full_name` | string | yes | |
2519
+
2520
+ ## lookup
2521
+
2522
+ ### lookup_business (workflow step)
2523
+
2524
+ - Look up business registration info by tax / registration code.
2525
+ - Defaults to Vietnam (country='VN').
2526
+
2527
+ **Inputs**
2528
+
2529
+ | Name | Type | Required | What it is |
2530
+ | --- | --- | --- | --- |
2531
+ | `tax_code` | string | yes | Business tax / registration code. Format varies by country; for VN this is a 10–13 digit mã số thuế. |
2532
+ | `country` | string | | ISO country code. Defaults to 'VN' (Vietnam). Only 'VN' is supported today. |
2533
+
2534
+ **Answer**
2535
+
2536
+ | Name | Type | Required | What it is |
2537
+ | --- | --- | --- | --- |
2538
+ | `country` | string | yes | |
2539
+ | `tax_code` | string | yes | |
2540
+ | `name` | string | yes | |
2541
+ | `address` | string | yes | |
2542
+ | `representative` | string \\| null | yes | |
2543
+ | `status` | string \\| null | yes | |
2544
+ | `international_name` | string \\| null | yes | |
2545
+ | `short_name` | string \\| null | yes | |
2546
+ | `operating_since` | string \\| null | yes | |
2547
+ | `managed_by` | string \\| null | yes | |
2548
+ | `company_type` | string \\| null | yes | |
2549
+ | `primary_industry` | string \\| null | yes | |
2550
+
2551
+ ## misa
2552
+
2553
+ ### misa_get_dictionary (workflow step)
2554
+
2555
+ - Read master-data records from MISA AMIS to look up codes (customer code, item code, warehouse code, etc.) before pushing a voucher.
2556
+
2557
+ **Inputs**
2558
+
2559
+ | Name | Type | Required | What it is |
2560
+ | --- | --- | --- | --- |
2561
+ | `connected_account_id` | string | yes | MISA connected account to read from |
2562
+ | `data_type` | 1 \\| 2 \\| 3 \\| 4 \\| 5 \\| 6 \\| 8 \\| 9 \\| 10 \\| 11 \\| 12 | yes | 1 objects (customers/suppliers/employees), 2 inventory items, 3 stocks, 4 units, 5 chart of accounts, 6 organization units, 8 bank accounts, 9 projects, 10 cost objects, 11 payment terms, 12 banks |
2563
+ | `skip` | integer | | |
2564
+ | `take` | integer | | Max 100 per page |
2565
+ | `last_sync_time` | string | | ISO timestamp — only return records changed since this time |
2566
+
2567
+ **Answer**
2568
+
2569
+ | Name | Type | Required | What it is |
2570
+ | --- | --- | --- | --- |
2571
+ | `success` | boolean | yes | |
2572
+ | `data` | any | yes | Raw dictionary records as returned by MISA |
2573
+ | `last_sync_time` | string | | Cursor — pass as last_sync_time on the next call to fetch only newer changes |
2574
+ | `error_code` | string | | |
2575
+ | `error_message` | string | | |
2576
+
2577
+ ### misa_save_bank_voucher (workflow step)
2578
+
2579
+ - Push a bank voucher (deposit / withdrawal / transfer) into MISA AMIS. voucher_type: 1 deposit (báo có), 3 withdrawal/debit-advice (báo nợ), 2 internal transfer. bank_account_id is the company-side bank account GUID — look it up with misa_get_dictionary (data_type 8). (workflow step)
2580
+
2581
+ **Inputs**
2582
+
2583
+ | Name | Type | Required | What it is |
2584
+ | --- | --- | --- | --- |
2585
+ | `voucher_type` | 1 \\| 2 \\| 3 | yes | |
2586
+ | `reftype` | integer | | |
2587
+ | `org_refid` | string | yes | Caller-controlled UUID identifying the source document |
2588
+ | `org_refno` | string | | Source-system document number |
2589
+ | `refdate` | string | yes | Document date, ISO 8601 |
2590
+ | `posted_date` | string | yes | Accounting posting date, ISO 8601 |
2591
+ | `branch_id` | string | | MISA branch GUID, optional for single-branch tenants |
2592
+ | `currency_id` | string | | Currency code, default VND |
2593
+ | `exchange_rate` | number | | FX rate, default 1.0 |
2594
+ | `journal_memo` | string | | Voucher memo/notes |
2595
+ | `custom_field1` | string | | |
2596
+ | `custom_field2` | string | | |
2597
+ | `custom_field3` | string | | |
2598
+ | `custom_field4` | string | | |
2599
+ | `custom_field5` | string | | |
2600
+ | `bank_account_id` | string | yes | Bank account GUID in MISA — look up via misa_get_dictionary (workflow step) |
2601
+ | `account_object_code` | string | | |
2602
+ | `account_object_name` | string | | |
2603
+ | `total_amount_oc` | number | yes | |
2604
+ | `total_amount` | number | yes | |
2605
+ | `detail` | object[] | yes | |
2606
+ | `detail[].description` | string | yes | |
2607
+ | `detail[].amount_oc` | number | yes | |
2608
+ | `detail[].amount` | number | yes | |
2609
+ | `detail[].debit_account` | string | yes | |
2610
+ | `detail[].credit_account` | string | yes | |
2611
+ | `detail[].sort_order` | integer | | |
2612
+ | `connected_account_id` | string | yes | MISA connected account to push to |
2613
+
2614
+ **Answer**
2615
+
2616
+ | Name | Type | Required | What it is |
2617
+ | --- | --- | --- | --- |
2618
+ | `queued` | boolean | yes | |
2619
+ | `org_refid` | string | yes | |
2620
+ | `error_code` | string | | |
2621
+ | `error_message` | string | | |
2622
+
2623
+ ### misa_save_cash_voucher (workflow step)
2624
+
2625
+ - Push a cash voucher (cash receipt or cash payment) into MISA AMIS. voucher_type: 5 receipt (thu tiền), 4 payment (chi tiền). detail array carries the journal lines with debit_account/credit_account per Vietnamese chart-of-accounts.
2626
+
2627
+ **Inputs**
2628
+
2629
+ | Name | Type | Required | What it is |
2630
+ | --- | --- | --- | --- |
2631
+ | `voucher_type` | 4 \\| 5 | yes | |
2632
+ | `reftype` | integer | | |
2633
+ | `org_refid` | string | yes | Caller-controlled UUID identifying the source document |
2634
+ | `org_refno` | string | | Source-system document number |
2635
+ | `refdate` | string | yes | Document date, ISO 8601 |
2636
+ | `posted_date` | string | yes | Accounting posting date, ISO 8601 |
2637
+ | `branch_id` | string | | MISA branch GUID, optional for single-branch tenants |
2638
+ | `currency_id` | string | | Currency code, default VND |
2639
+ | `exchange_rate` | number | | FX rate, default 1.0 |
2640
+ | `journal_memo` | string | | Voucher memo/notes |
2641
+ | `custom_field1` | string | | |
2642
+ | `custom_field2` | string | | |
2643
+ | `custom_field3` | string | | |
2644
+ | `custom_field4` | string | | |
2645
+ | `custom_field5` | string | | |
2646
+ | `account_object_code` | string | | Counterparty code (customer/supplier/employee) |
2647
+ | `account_object_name` | string | | |
2648
+ | `total_amount_oc` | number | yes | |
2649
+ | `total_amount` | number | yes | |
2650
+ | `detail` | object[] | yes | |
2651
+ | `detail[].description` | string | yes | |
2652
+ | `detail[].amount_oc` | number | yes | |
2653
+ | `detail[].amount` | number | yes | |
2654
+ | `detail[].debit_account` | string | yes | |
2655
+ | `detail[].credit_account` | string | yes | |
2656
+ | `detail[].sort_order` | integer | | |
2657
+ | `connected_account_id` | string | yes | MISA connected account to push to |
2658
+
2659
+ **Answer**
2660
+
2661
+ | Name | Type | Required | What it is |
2662
+ | --- | --- | --- | --- |
2663
+ | `queued` | boolean | yes | |
2664
+ | `org_refid` | string | yes | |
2665
+ | `error_code` | string | | |
2666
+ | `error_message` | string | | |
2667
+
2668
+ ### misa_save_dictionary (workflow step)
2669
+
2670
+ - Create or update master-data records in MISA AMIS (customers, suppliers, items, warehouses, etc.).
2671
+ - Use this before pushing a voucher that references a code MISA doesn't yet know about.
2672
+
2673
+ **Inputs**
2674
+
2675
+ | Name | Type | Required | What it is |
2676
+ | --- | --- | --- | --- |
2677
+ | `connected_account_id` | string | yes | MISA connected account to push to |
2678
+ | `dictionary_type` | 1 \\| 2 \\| 3 \\| 4 \\| 5 \\| 6 \\| 7 \\| 8 \\| 9 \\| 10 \\| 12 | yes | 1 customers/suppliers/employees, 2 object groups, 3 inventory items, 4 item categories, 5 warehouses, 6 units, 7 bank accounts, 8 banks, 9 expense items, 10 revenue/expense categories, 12 cost allocation |
2679
+ | `items` | object[] | yes | Master-data records to create or update. 1–200 per call. Each item's required fields depend on dictionary_type — see MISA Open API docs (chat, MCP, CLI) |
2680
+
2681
+ **Answer**
2682
+
2683
+ | Name | Type | Required | What it is |
2684
+ | --- | --- | --- | --- |
2685
+ | `queued` | boolean | yes | |
2686
+ | `count` | integer | yes | |
2687
+ | `error_code` | string | | |
2688
+ | `error_message` | string | | |
2689
+
2690
+ ### misa_save_purchase_voucher (workflow step)
2691
+
2692
+ - Push a purchase voucher (purchase invoice / return / discount-debit-note-to-supplier / service / general purchase / purchase order) into MISA AMIS. voucher_type: 15 invoice, 18 voucher, 17 service, 16 return, 14 discount (debit note to supplier), 21 purchase order. account_object_code identifies the supplier in MISA — must already exist.
2693
+ - MISA sync ack only confirms queueing; final accept/reject arrives async.
2694
+
2695
+ **Inputs**
2696
+
2697
+ | Name | Type | Required | What it is |
2698
+ | --- | --- | --- | --- |
2699
+ | `voucher_type` | 14 \\| 15 \\| 16 \\| 17 \\| 18 \\| 21 | yes | |
2700
+ | `reftype` | integer | | |
2701
+ | `org_refid` | string | yes | Caller-controlled UUID identifying the source document |
2702
+ | `org_refno` | string | | Source-system document number |
2703
+ | `refdate` | string | yes | Document date, ISO 8601 |
2704
+ | `posted_date` | string | yes | Accounting posting date, ISO 8601 |
2705
+ | `branch_id` | string | | MISA branch GUID, optional for single-branch tenants |
2706
+ | `currency_id` | string | | Currency code, default VND |
2707
+ | `exchange_rate` | number | | FX rate, default 1.0 |
2708
+ | `journal_memo` | string | | Voucher memo/notes |
2709
+ | `custom_field1` | string | | |
2710
+ | `custom_field2` | string | | |
2711
+ | `custom_field3` | string | | |
2712
+ | `custom_field4` | string | | |
2713
+ | `custom_field5` | string | | |
2714
+ | `account_object_code` | string | yes | Supplier code in MISA |
2715
+ | `account_object_name` | string | | |
2716
+ | `account_object_tax_code` | string | | |
2717
+ | `account_object_address` | string | | |
2718
+ | `total_amount_oc` | number | yes | |
2719
+ | `total_amount` | number | yes | |
2720
+ | `total_vat_amount_oc` | number | yes | |
2721
+ | `total_vat_amount` | number | yes | |
2722
+ | `detail` | object[] | yes | |
2723
+ | `detail[].inventory_item_code` | string | | Item/product code in MISA. Skip when is_description=true |
2724
+ | `detail[].inventory_item_name` | string | yes | Item/product display name |
2725
+ | `detail[].inventory_item_type` | 0 \\| 1 \\| 2 \\| 3 | | Item type — 0 goods, 1 finished, 2 service, 3 raw material |
2726
+ | `detail[].description` | string | | Line description |
2727
+ | `detail[].is_description` | boolean | | Description-only line — when true, only `description` is required |
2728
+ | `detail[].stock_code` | string | | Warehouse code in MISA |
2729
+ | `detail[].unit_name` | string | | Unit of measure name |
2730
+ | `detail[].quantity` | number | yes | Line quantity |
2731
+ | `detail[].unit_price` | number | yes | Unit price (in currency_id of voucher) |
2732
+ | `detail[].amount_oc` | number | yes | Line total in original currency |
2733
+ | `detail[].amount` | number | yes | Line total in accounting currency (= amount_oc when VND) |
2734
+ | `detail[].discount_rate` | number | | Line discount percent |
2735
+ | `detail[].discount_amount_oc` | number | | Discount amount, original currency |
2736
+ | `detail[].discount_amount` | number | | Discount amount, accounting currency |
2737
+ | `detail[].vat_rate` | number | yes | VAT percent. 0/5/8/10 for standard, -1 exempt, -2 not creditable, -3 other (set other_vat_rate) |
2738
+ | `detail[].other_vat_rate` | number | | Custom VAT percent — required when vat_rate=-3 |
2739
+ | `detail[].vat_amount_oc` | number | yes | VAT amount, original currency |
2740
+ | `detail[].vat_amount` | number | yes | VAT amount, accounting currency |
2741
+ | `detail[].debit_account` | string | yes | Chart-of-accounts code on debit side, e.g. 131 |
2742
+ | `detail[].credit_account` | string | yes | Chart-of-accounts code on credit side, e.g. 511 |
2743
+ | `detail[].sale_account` | string | | |
2744
+ | `detail[].vat_account` | string | | |
2745
+ | `detail[].inventory_account` | string | | |
2746
+ | `detail[].sort_order` | integer | | |
2747
+ | `detail[].lot_no` | string | | |
2748
+ | `detail[].expiry_date` | string | | ISO date |
2749
+ | `detail[].organization_unit_code` | string | | Department/branch code |
2750
+ | `connected_account_id` | string | yes | MISA connected account to push to |
2751
+
2752
+ **Answer**
2753
+
2754
+ | Name | Type | Required | What it is |
2755
+ | --- | --- | --- | --- |
2756
+ | `queued` | boolean | yes | |
2757
+ | `org_refid` | string | yes | |
2758
+ | `error_code` | string | | |
2759
+ | `error_message` | string | | |
2760
+
2761
+ ### misa_save_sales_voucher (workflow step)
2762
+
2763
+ - Push a sales voucher (invoice / sales return / discount-credit-note / sales order) into MISA AMIS. voucher_type: 11 invoice, 13 sales voucher, 12 return, 10 discount/credit note, 20 sales order. reftype refines the sub-type (e.g. 3530 unpaid sale, 3560 sales invoice, 3571 service cash). account_object_code identifies the customer in MISA — must already exist (use misa_save_dictionary first if not). (workflow step)
2764
+ - MISA sync ack only confirms queueing; final accept/reject arrives async on the registered callback URL.
2765
+
2766
+ **Inputs**
2767
+
2768
+ | Name | Type | Required | What it is |
2769
+ | --- | --- | --- | --- |
2770
+ | `voucher_type` | 10 \\| 11 \\| 12 \\| 13 \\| 20 | yes | |
2771
+ | `reftype` | integer | | Voucher sub-type code — MISA assigns a default when omitted |
2772
+ | `org_refid` | string | yes | Caller-controlled UUID identifying the source document |
2773
+ | `org_refno` | string | | Source-system document number |
2774
+ | `refdate` | string | yes | Document date, ISO 8601 |
2775
+ | `posted_date` | string | yes | Accounting posting date, ISO 8601 |
2776
+ | `branch_id` | string | | MISA branch GUID, optional for single-branch tenants |
2777
+ | `currency_id` | string | | Currency code, default VND |
2778
+ | `exchange_rate` | number | | FX rate, default 1.0 |
2779
+ | `journal_memo` | string | | Voucher memo/notes |
2780
+ | `custom_field1` | string | | |
2781
+ | `custom_field2` | string | | |
2782
+ | `custom_field3` | string | | |
2783
+ | `custom_field4` | string | | |
2784
+ | `custom_field5` | string | | |
2785
+ | `account_object_code` | string | yes | Customer code in MISA |
2786
+ | `account_object_name` | string | | |
2787
+ | `account_object_tax_code` | string | | |
2788
+ | `account_object_address` | string | | |
2789
+ | `employee_code` | string | | Salesperson code |
2790
+ | `employee_name` | string | | |
2791
+ | `total_sale_amount_oc` | number | yes | |
2792
+ | `total_sale_amount` | number | yes | |
2793
+ | `total_discount_amount_oc` | number | | |
2794
+ | `total_discount_amount` | number | | |
2795
+ | `total_vat_amount_oc` | number | yes | |
2796
+ | `total_vat_amount` | number | yes | |
2797
+ | `total_amount_oc` | number | yes | |
2798
+ | `total_amount` | number | yes | |
2799
+ | `is_sale_with_outward` | boolean | | Auto-generate stock-out slip |
2800
+ | `detail` | object[] | yes | |
2801
+ | `detail[].inventory_item_code` | string | | Item/product code in MISA. Skip when is_description=true |
2802
+ | `detail[].inventory_item_name` | string | yes | Item/product display name |
2803
+ | `detail[].inventory_item_type` | 0 \\| 1 \\| 2 \\| 3 | | Item type — 0 goods, 1 finished, 2 service, 3 raw material |
2804
+ | `detail[].description` | string | | Line description |
2805
+ | `detail[].is_description` | boolean | | Description-only line — when true, only `description` is required |
2806
+ | `detail[].stock_code` | string | | Warehouse code in MISA |
2807
+ | `detail[].unit_name` | string | | Unit of measure name |
2808
+ | `detail[].quantity` | number | yes | Line quantity |
2809
+ | `detail[].unit_price` | number | yes | Unit price (in currency_id of voucher) |
2810
+ | `detail[].amount_oc` | number | yes | Line total in original currency |
2811
+ | `detail[].amount` | number | yes | Line total in accounting currency (= amount_oc when VND) |
2812
+ | `detail[].discount_rate` | number | | Line discount percent |
2813
+ | `detail[].discount_amount_oc` | number | | Discount amount, original currency |
2814
+ | `detail[].discount_amount` | number | | Discount amount, accounting currency |
2815
+ | `detail[].vat_rate` | number | yes | VAT percent. 0/5/8/10 for standard, -1 exempt, -2 not creditable, -3 other (set other_vat_rate) |
2816
+ | `detail[].other_vat_rate` | number | | Custom VAT percent — required when vat_rate=-3 |
2817
+ | `detail[].vat_amount_oc` | number | yes | VAT amount, original currency |
2818
+ | `detail[].vat_amount` | number | yes | VAT amount, accounting currency |
2819
+ | `detail[].debit_account` | string | yes | Chart-of-accounts code on debit side, e.g. 131 |
2820
+ | `detail[].credit_account` | string | yes | Chart-of-accounts code on credit side, e.g. 511 |
2821
+ | `detail[].sale_account` | string | | |
2822
+ | `detail[].vat_account` | string | | |
2823
+ | `detail[].inventory_account` | string | | |
2824
+ | `detail[].sort_order` | integer | | |
2825
+ | `detail[].lot_no` | string | | |
2826
+ | `detail[].expiry_date` | string | | ISO date |
2827
+ | `detail[].organization_unit_code` | string | | Department/branch code |
2828
+ | `connected_account_id` | string | yes | MISA connected account to push to |
2829
+
2830
+ **Answer**
2831
+
2832
+ | Name | Type | Required | What it is |
2833
+ | --- | --- | --- | --- |
2834
+ | `queued` | boolean | yes | |
2835
+ | `org_refid` | string | yes | |
2836
+ | `error_code` | string | | |
2837
+ | `error_message` | string | | |
2838
+
2839
+ ## outlook
2840
+
2841
+ ### outlook_count_emails (workflow step)
2842
+
2843
+ - Count Outlook emails matching a filter or search query.
2844
+
2845
+ **Inputs**
2846
+
2847
+ | Name | Type | Required | What it is |
2848
+ | --- | --- | --- | --- |
2849
+ | `connected_account_id` | string | yes | The Lotics connected account ID (cac_xxx), not the Microsoft user ID |
2850
+ | `search` | string | | KQL expression |
2851
+ | `filter` | string | | OData expression |
2852
+ | `folder` | string | | Mail folder: well-known name or folder ID |
2853
+ | `user_id` | string | | Mailbox owner user ID. |
2854
+
2855
+ **Answer**
2856
+
2857
+ | Name | Type | Required | What it is |
2858
+ | --- | --- | --- | --- |
2859
+ | `count` | number | yes | Number of matching emails |
2860
+
2861
+ ### outlook_query_emails (workflow step)
2862
+
2863
+ - Search and filter Outlook emails.
2864
+ - Two modes: search (KQL keywords) or structured filters (from, to, subject, dates, etc.).
2865
+ - When search is provided, structured filters are ignored. ## KQL search syntax (for the search field) Bare keywords search across from, subject, and body.
2866
+ - Property restrictions (no space after colon): - People: from:, to:, cc:, bcc:, participants: (all people fields), recipients: (to+cc+bcc) - Content: subject:, body:, "exact phrase" - Attachments: hasAttachments:true, attachment:filename* - Dates: received:2024-01-01, received:2024-01-01..2024-01-31, received>=2024-01-01, received:today, received:"this week", sent:2024-06-01 - Size (bytes): size>1048576, size:1..10485760 - Status: importance:high, isRead:false, kind:email Combining (UPPERCASE required): AND, OR, NOT, - (exclude), () for grouping.
2867
+ - Prefix wildcard: subject:set* (end of word only, no *prefix or *mid*dle).
2868
+ - Examples: - from:john@contoso.com AND subject:"quarterly report" - participants:alice importance:high hasAttachments:true - body:contract AND received>=2024-01-01 AND received<=2024-06-30 - (from:legal OR from:compliance) AND subject:contract - attachment:annual* received:"this month"
2869
+
2870
+ **Inputs**
2871
+
2872
+ | Name | Type | Required | What it is |
2873
+ | --- | --- | --- | --- |
2874
+ | `connected_account_id` | string | yes | The Lotics connected account ID (cac_xxx), not the Microsoft user ID |
2875
+ | `search` | string | | KQL search query — overrides all structured filter fields when provided |
2876
+ | `from` | string | | Sender email address exact match |
2877
+ | `to` | string | | Recipient email address exact match |
2878
+ | `subject` | string | | Subject starts with this text |
2879
+ | `after` | string | | ISO date — received on or after |
2880
+ | `before` | string | | ISO date — received before |
2881
+ | `is_read` | boolean | | |
2882
+ | `is_draft` | boolean | | |
2883
+ | `has_attachments` | boolean | | |
2884
+ | `importance` | "low" \\| "normal" \\| "high" | | |
2885
+ | `is_flagged` | boolean | | Whether the email is flagged for follow-up |
2886
+ | `classification` | "focused" \\| "other" | | Focused Inbox classification |
2887
+ | `category` | string | | Color category name |
2888
+ | `conversation_id` | string | | Outlook conversation ID — retrieves all messages in a thread |
2889
+ | `folder` | string | | Mail folder: well-known name (inbox, sentitems, drafts, deleteditems, junkemail, archive) or folder ID |
2890
+ | `skip` | number | | Number of results to skip for pagination. |
2891
+ | `max_result` | number | yes | Maximum number of emails to retrieve (1-50) |
2892
+ | `user_id` | string | | The ID of the user whose mailbox the email belongs to. If not provided, the connected account's user ID (me) will be used. |
2893
+
2894
+ **Answer**
2895
+
2896
+ | Name | Type | Required | What it is |
2897
+ | --- | --- | --- | --- |
2898
+ | `messages` | object[] | yes | List of matching Outlook messages |
2899
+ | `messages[].id` | string | yes | Outlook message ID |
2900
+ | `messages[].date` | string | yes | Email date in the workspace timezone, with its offset |
2901
+ | `messages[].from` | string | yes | Sender email address |
2902
+ | `messages[].subject` | string | yes | Email subject |
2903
+ | `messages[].to` | string | yes | Recipient email address |
2904
+ | `messages[].cc` | string \\| null | yes | CC recipients |
2905
+ | `messages[].bcc` | string \\| null | yes | BCC recipients |
2906
+ | `messages[].snippet` | string | yes | Short plain-text preview of the email body (first ~255 chars) |
2907
+ | `messages[].conversationId` | string | | Outlook conversation ID |
2908
+ | `messages[].receivedDateTime` | string | | Received date-time in ISO format |
2909
+ | `messages[].hasAttachments` | boolean | | Whether the email has attachments |
2910
+ | `messages[].importance` | string | | Email importance level |
2911
+ | `messages[].isRead` | boolean | | Whether the email has been read |
2912
+ | `messages[].isDraft` | boolean | | Whether the email is a draft |
2913
+ | `messages[].flagStatus` | string | | Flag status: notFlagged, complete, or flagged |
2914
+ | `messages[].classification` | string | | Focused Inbox classification: focused or other |
2915
+ | `messages[].categories` | string[] | | Color categories assigned to the email |
2916
+
2917
+ ### outlook_query_folders (workflow step)
2918
+
2919
+ - List mail folders in an Outlook mailbox.
2920
+
2921
+ **Inputs**
2922
+
2923
+ | Name | Type | Required | What it is |
2924
+ | --- | --- | --- | --- |
2925
+ | `connected_account_id` | string | yes | The Lotics connected account ID (cac_xxx), not the Microsoft user ID |
2926
+ | `parent_folder_id` | string | | Parent folder ID to list child folders. Omit for top-level folders. |
2927
+ | `name` | string | | Match folders by display name prefix. |
2928
+ | `include_hidden` | boolean | | Include hidden system folders |
2929
+ | `max_result` | number | | Maximum number of folders to return (1-100) |
2930
+ | `skip` | number | | Number of results to skip for pagination |
2931
+ | `user_id` | string | | The ID of the user whose mailbox to query. Defaults to the connected account owner. |
2932
+
2933
+ **Answer**
2934
+
2935
+ | Name | Type | Required | What it is |
2936
+ | --- | --- | --- | --- |
2937
+ | `folders` | object[] | yes | List of mail folders |
2938
+ | `folders[].id` | string | yes | Folder ID |
2939
+ | `folders[].displayName` | string | yes | Folder display name |
2940
+ | `folders[].parentFolderId` | string | | Parent folder ID |
2941
+ | `folders[].childFolderCount` | number | yes | Number of child folders |
2942
+ | `folders[].totalItemCount` | number | yes | Total number of items in the folder |
2943
+ | `folders[].unreadItemCount` | number | yes | Number of unread items |
2944
+ | `folders[].isHidden` | boolean | yes | Whether the folder is hidden |
2945
+
2946
+ ### outlook_read_email (workflow step)
2947
+
2948
+ - Fetch an Outlook email's body and the list of its attachments.
2949
+ - Attachments are stored as workspace files — the result names each one's file_id; read one with view_files, attach one to a record with update_records. (workflow step, chat)
2950
+
2951
+ **Inputs**
2952
+
2953
+ | Name | Type | Required | What it is |
2954
+ | --- | --- | --- | --- |
2955
+ | `connected_account_id` | string | yes | The Lotics connected account ID (cac_xxx), not the Microsoft user ID |
2956
+ | `message_id` | string | yes | The ID of the Outlook message to retrieve |
2957
+ | `user_id` | string | | The ID of the user whose mailbox the email belongs to. If not provided, the connected account's user ID (me) will be used. |
2958
+
2959
+ **Answer**
2960
+
2961
+ | Name | Type | Required | What it is |
2962
+ | --- | --- | --- | --- |
2963
+ | `message` | object | yes | The full Outlook message |
2964
+ | `message.id` | string | | Outlook message ID |
2965
+ | `message.date` | string | yes | Email date in the workspace timezone, with its offset |
2966
+ | `message.from` | string | yes | Sender email address |
2967
+ | `message.subject` | string | yes | Email subject |
2968
+ | `message.to` | string | yes | Recipient email address |
2969
+ | `message.cc` | string \\| null | yes | CC recipients |
2970
+ | `message.bcc` | string \\| null | yes | BCC recipients |
2971
+ | `message.inReplyTo` | string \\| null | yes | In-Reply-To header |
2972
+ | `message.replyTo` | string \\| null | yes | Reply-To header |
2973
+ | `message.references` | string[] \\| null | yes | References header |
2974
+ | `message.conversationId` | string | | Outlook conversation ID |
2975
+ | `message.receivedDateTime` | string | | Received date-time in ISO format |
2976
+ | `message.hasAttachments` | boolean | | Whether the email has attachments |
2977
+ | `message.importance` | string | | Email importance level |
2978
+ | `message.isRead` | boolean | | Whether the email has been read |
2979
+ | `message.body` | object | yes | Email body |
2980
+ | `message.body.content` | string | yes | Body content |
2981
+ | `message.body.contentType` | "text" \\| "html" | yes | Body content type |
2982
+ | `message.attachments` | object[] | | Email attachments |
2983
+ | `message.attachments[].id` | string | yes | Outlook attachment ID |
2984
+ | `message.attachments[].fileName` | string | | Attachment filename as stored, which may differ from the sender's |
2985
+ | `message.attachments[].contentType` | string | | MIME type as stored, recovered from the filename when Graph declared a generic one |
2986
+ | `message.attachments[].size` | number | | Stored size in bytes |
2987
+ | `message.attachments[].file_id` | string | | Stored file ID — pass to view_files to read it, or to update_records to attach it (workflow step, chat) |
2988
+
2989
+ ### outlook_reply_email (workflow step)
2990
+
2991
+ - Draft or send a reply to an Outlook email.
2992
+ - Use reply_body (markdown) or template_id + template_data — not both.
2993
+ - Attach stored files by passing their file_ids.
2994
+ - Leaves an unsent draft unless draft is false.
2995
+
2996
+ **Inputs**
2997
+
2998
+ | Name | Type | Required | What it is |
2999
+ | --- | --- | --- | --- |
3000
+ | `connected_account_id` | string | yes | The Lotics connected account ID (cac_xxx), not the Microsoft user ID |
3001
+ | `original_message_id` | string | yes | |
3002
+ | `reply_body` | string | | Reply body (markdown). Mutually exclusive with template_id. |
3003
+ | `template_id` | string | | |
3004
+ | `template_data` | object | | |
3005
+ | `cc` | string | | CC recipients, comma-separated |
3006
+ | `bcc` | string | | BCC recipients, comma-separated |
3007
+ | `draft` | boolean | | Leave true to save an unsent draft the member reviews. Pass false only to deliver the message now — delivery is irreversible. |
3008
+ | `file_ids` | string[] | yes | |
3009
+ | `user_id` | string | | Mailbox user ID |
3010
+
3011
+ **Answer**
3012
+
3013
+ | Name | Type | Required | What it is |
3014
+ | --- | --- | --- | --- |
3015
+ | `message_id` | string | yes | The ID of the sent message or saved draft |
3016
+ | `subject` | string | yes | The subject as sent |
3017
+ | `html` | string | yes | The body as sent, rendered to HTML |
3018
+ | `markdown` | string | | The body as written in markdown; absent when a template rendered it |
3019
+ | `to` | string | yes | The original sender the reply went to |
3020
+
3021
+ ### outlook_send_email (workflow step)
3022
+
3023
+ - Draft or send an Outlook email.
3024
+ - Use content (markdown) or template_id + template_data — not both.
3025
+ - Attach stored files by passing their file_ids.
3026
+ - Leaves an unsent draft unless draft is false, and while drafting 'to' may be omitted to leave the recipient line for the member to fill in.
3027
+
3028
+ **Inputs**
3029
+
3030
+ | Name | Type | Required | What it is |
3031
+ | --- | --- | --- | --- |
3032
+ | `connected_account_id` | string | yes | The Lotics connected account ID (cac_xxx), not the Microsoft user ID |
3033
+ | `to` | string | | Recipient email(s), comma-separated. Required unless using a template. |
3034
+ | `subject` | string | | |
3035
+ | `cc` | string | | CC recipients, comma-separated |
3036
+ | `bcc` | string | | BCC recipients, comma-separated |
3037
+ | `content` | string | | Email body (markdown). Mutually exclusive with template_id. |
3038
+ | `template_id` | string | | |
3039
+ | `template_data` | object | | |
3040
+ | `draft` | boolean | | Leave true to save an unsent draft the member reviews. Pass false only to deliver the message now — delivery is irreversible. |
3041
+ | `file_ids` | string[] | yes | |
3042
+ | `user_id` | string | | Mailbox user ID |
3043
+
3044
+ **Answer**
3045
+
3046
+ | Name | Type | Required | What it is |
3047
+ | --- | --- | --- | --- |
3048
+ | `message_id` | string | yes | The ID of the sent message or saved draft |
3049
+ | `subject` | string | yes | The subject as sent |
3050
+ | `html` | string | yes | The body as sent, rendered to HTML |
3051
+ | `markdown` | string | | The body as written in markdown; absent when a template rendered it |
3052
+ | `to` | string \\| null | yes | The recipients as sent, comma-separated; null on a draft saved without recipients |
3053
+
3054
+ ## press
3055
+
3056
+ ### press_button (workflow step)
3057
+
3058
+ - Run a button field's action against a record — equivalent to a user clicking the button in the UI.
3059
+ - Buttons are a legacy field type; the action must already be wired.
3060
+
3061
+ **Inputs**
3062
+
3063
+ | Name | Type | Required | What it is |
3064
+ | --- | --- | --- | --- |
3065
+ | `table_id` | string | yes | |
3066
+ | `record_id` | string | yes | |
3067
+ | `field_key` | string | yes | |
3068
+
3069
+ **Answer**
3070
+
3071
+ | Name | Type | Required | What it is |
3072
+ | --- | --- | --- | --- |
3073
+ | `execution_id` | string | | |
3074
+ | `status` | "success" \\| "error" | | |
3075
+ | `message` | string | | |
3076
+
3077
+ ## rename
3078
+
3079
+ ### rename_file (workflow step)
3080
+
3081
+ - Get a file under another name: a new file over the same bytes.
3082
+ - Write its file_id into the files field in place of the old one; every other place holding the old file keeps its name.
3083
+
3084
+ **Inputs**
3085
+
3086
+ | Name | Type | Required | What it is |
3087
+ | --- | --- | --- | --- |
3088
+ | `file_id` | string | yes | |
3089
+ | `filename` | string | yes | The whole new name, keeping the file's extension exactly. |
3090
+
3091
+ **Answer**
3092
+
3093
+ | Name | Type | Required | What it is |
3094
+ | --- | --- | --- | --- |
3095
+ | `file_id` | string | yes | The ID of the generated file. |
3096
+ | `url` | string | yes | The download URL of the generated file. |
3097
+ | `filename` | string | yes | The filename of the generated file, including extension. |
3098
+ | `mime_type` | string | yes | The MIME type of the generated file. |
3099
+
3100
+ ## save
3101
+
3102
+ ### save_file (workflow step)
3103
+
3104
+ - Save a file from a URL to the workspace.
3105
+ - Max 20MB.
3106
+
3107
+ **Inputs**
3108
+
3109
+ | Name | Type | Required | What it is |
3110
+ | --- | --- | --- | --- |
3111
+ | `url` | string | yes | Public URL to download the file from (https:// or http://). |
3112
+ | `filename` | string | | Filename with extension, e.g. 'report.pdf'. Derived from URL if omitted. |
3113
+ | `mime_type` | string | | MIME type, e.g. 'application/pdf'. Derived from URL response if omitted. |
3114
+
3115
+ **Answer**
3116
+
3117
+ | Name | Type | Required | What it is |
3118
+ | --- | --- | --- | --- |
3119
+ | `id` | string | yes | File ID. |
3120
+ | `filename` | string | yes | |
3121
+ | `mime_type` | string | yes | |
3122
+ | `url` | string | yes | |
3123
+
3124
+ ## send
3125
+
3126
+ ### send_notification (workflow step)
3127
+
3128
+ - Send a notification to workspace members. recipients is an array of principals: { type, id }.
3129
+ - All members: [{ type: "organization", id: "{{organization_id}}" }] Who triggered: [{ type: "member", id: "{{triggered_by_member_id}}" }] A group: [{ type: "member_group", id: "<group_id>" }]
3130
+
3131
+ **Inputs**
3132
+
3133
+ | Name | Type | Required | What it is |
3134
+ | --- | --- | --- | --- |
3135
+ | `recipients` | any[] | yes | List of recipients. Each entry is a principal: { type: 'member', id } \| { type: 'member_group', id } \| { type: 'organization', id } |
3136
+ | `title` | string | yes | |
3137
+ | `body` | string | yes | |
3138
+ | `level` | "urgent" \\| "warning" \\| "info" \\| "success" | | Notification level: urgent, warning, info, success |
3139
+
3140
+ **Answer**
3141
+
3142
+ | Name | Type | Required | What it is |
3143
+ | --- | --- | --- | --- |
3144
+ | `message` | string | yes | |
3145
+ | `recipients_count` | number | yes | |
3146
+
3147
+ ## telegram
3148
+
3149
+ ### telegram_list_chats (workflow step)
3150
+
3151
+ - List the chats that messaged a Telegram bot, or added it, in the last 24 hours — where a chat id comes from.
3152
+
3153
+ **Inputs**
3154
+
3155
+ | Name | Type | Required | What it is |
3156
+ | --- | --- | --- | --- |
3157
+ | `connected_account_id` | string | yes | Telegram connected account |
3158
+
3159
+ **Answer**
3160
+
3161
+ | Name | Type | Required | What it is |
3162
+ | --- | --- | --- | --- |
3163
+ | `chats` | object[] | yes | |
3164
+ | `chats[].chat_id` | string | yes | |
3165
+ | `chats[].type` | string | yes | private, group, supergroup or channel |
3166
+ | `chats[].name` | string | yes | |
3167
+ | `chats[].username` | string | | |
3168
+ | `chats[].last_seen_at` | string | yes | ISO timestamp of the chat's latest update |
3169
+
3170
+ ### telegram_send_document (workflow step)
3171
+
3172
+ - Send a stored file from a Telegram bot to a chat, as a document with an optional caption.
3173
+ - The chat must have messaged the bot first.
3174
+
3175
+ **Inputs**
3176
+
3177
+ | Name | Type | Required | What it is |
3178
+ | --- | --- | --- | --- |
3179
+ | `connected_account_id` | string | yes | Telegram connected account |
3180
+ | `chat_id` | string | yes | Numeric chat id, or the @username of a public channel or group |
3181
+ | `file_id` | string | yes | |
3182
+ | `caption` | string | | |
3183
+ | `parse_mode` | "HTML" \\| "MarkdownV2" | | How the text is formatted: Telegram's HTML tags or its MarkdownV2 syntax |
3184
+ | `disable_notification` | boolean | | Deliver without a notification sound |
3185
+
3186
+ **Answer**
3187
+
3188
+ | Name | Type | Required | What it is |
3189
+ | --- | --- | --- | --- |
3190
+ | `message_id` | number | yes | |
3191
+ | `chat_id` | string | yes | |
3192
+ | `sent_at` | string | yes | ISO timestamp |
3193
+
3194
+ ### telegram_send_message (workflow step)
3195
+
3196
+ - Send a text message from a Telegram bot to a chat.
3197
+ - The chat must have messaged the bot first.
3198
+
3199
+ **Inputs**
3200
+
3201
+ | Name | Type | Required | What it is |
3202
+ | --- | --- | --- | --- |
3203
+ | `connected_account_id` | string | yes | Telegram connected account |
3204
+ | `chat_id` | string | yes | Numeric chat id, or the @username of a public channel or group |
3205
+ | `text` | string | yes | |
3206
+ | `parse_mode` | "HTML" \\| "MarkdownV2" | | How the text is formatted: Telegram's HTML tags or its MarkdownV2 syntax |
3207
+ | `disable_notification` | boolean | | Deliver without a notification sound |
3208
+
3209
+ **Answer**
3210
+
3211
+ | Name | Type | Required | What it is |
3212
+ | --- | --- | --- | --- |
3213
+ | `message_id` | number | yes | |
3214
+ | `chat_id` | string | yes | |
3215
+ | `sent_at` | string | yes | ISO timestamp |
3216
+
3217
+ ## threads
3218
+
3219
+ ### threads_create_post (workflow step)
3220
+
3221
+ - Publish a post to the connected Threads account.
3222
+
3223
+ **Inputs**
3224
+
3225
+ | Name | Type | Required | What it is |
3226
+ | --- | --- | --- | --- |
3227
+ | `connected_account_id` | string | yes | |
3228
+ | `text` | string | yes | |
3229
+ | `link` | string | | Shown as a link card. A post carries either a link or media. |
3230
+ | `media_file_ids` | string[] | | One image or video, or 2–20 images and videos as a carousel. |
3231
+
3232
+ **Answer**
3233
+
3234
+ | Name | Type | Required | What it is |
3235
+ | --- | --- | --- | --- |
3236
+ | `post_id` | string | yes | |
3237
+ | `url` | string | yes | |
3238
+
3239
+ ## vietcombank
3240
+
3241
+ ### vietcombank_convert_currency (workflow step)
3242
+
3243
+ - Convert between currencies using live Vietcombank exchange rates.
3244
+
3245
+ **Inputs**
3246
+
3247
+ | Name | Type | Required | What it is |
3248
+ | --- | --- | --- | --- |
3249
+ | `from_currency` | string | yes | Source currency code (e.g., 'USD', 'EUR', 'JPY') |
3250
+ | `to_currency` | string | yes | Target currency code (e.g., 'USD', 'EUR', 'JPY') |
3251
+ | `amount` | number | yes | The amount to convert (must be positive) |
3252
+
3253
+ **Answer**
3254
+
3255
+ | Name | Type | Required | What it is |
3256
+ | --- | --- | --- | --- |
3257
+ | `converted_amount` | number | yes | The converted amount |
3258
+ | `exchange_rate` | number | yes | The exchange rate |
3259
+
3260
+ ## view
3261
+
3262
+ ### view_files (workflow step)
3263
+
3264
+ - View one or more files in a single call.
3265
+ - Two modes: - file_ids: explicit list of file IDs (use for cherry-picked files). - source: every file attached to a record's file field (use when you want all photos/attachments on a record).
3266
+ - Provide exactly one.
3267
+ - Reads EVERY readable format: images, PDFs, Word (.docx and legacy .doc), Excel (.xlsx and legacy .xls), CSV, and text formats (.txt, .md, .json, .xml, .yaml, .html).
3268
+ - Batch limit: 100 files.
3269
+ - Use this whenever you are handed a file_id you cannot already see — images and PDFs arrive in your context natively, but every other format is a reference you must open with this tool.
3270
+ - Files already in your context — those the user attached to the current message, and those an earlier view_files call returned this conversation — return a text-only "already in context" reference instead of re-emitting bytes. (workflow step, chat)
3271
+ - You do not need to re-call view_files to look at the same image again; scroll back to the original tool_result. (workflow step, chat)
3272
+ - Calling with already-seen file_ids is safe but wasteful.
3273
+
3274
+ **Inputs**
3275
+
3276
+ | Name | Type | Required | What it is |
3277
+ | --- | --- | --- | --- |
3278
+ | `file_ids` | string[] | | |
3279
+ | `source` | object | | |
3280
+ | `source.record_id` | string | yes | |
3281
+ | `source.field_key` | string | yes | |
3282
+
3283
+ **Answer**
3284
+
3285
+ | Name | Type | Required | What it is |
3286
+ | --- | --- | --- | --- |
3287
+ | `files` | object[] | yes | |
3288
+ | `files[].file_id` | string | yes | |
3289
+ | `files[].filename` | string | yes | |
3290
+ | `files[].mime_type` | string | yes | |
3291
+ | `files[].content` | object | | |
3292
+ | `files[].already_in_context` | boolean | | |
3293
+ | `files[].error` | string | | |
3294
+
3295
+ ## wininvoice
3296
+
3297
+ ### wininvoice_create_or_update_invoice (workflow step)
3298
+
3299
+ - Create or update a Vietnamese e-invoice in WinInvoice. invRef identifies the invoice: a value that already has one resolves to that invoice rather than issuing a new one, and isExisting: 1 means it came back unchanged with nothing issued.
3300
+ - Derive invRef from what is being billed rather than from a record that may later describe something else.
3301
+
3302
+ **Inputs**
3303
+
3304
+ | Name | Type | Required | What it is |
3305
+ | --- | --- | --- | --- |
3306
+ | `invName` | string | yes | Invoice sample name, ex: 1,2,6 |
3307
+ | `invSerial` | string | yes | Invoice sign, ex: C24TAA, K24TXX |
3308
+ | `invNumber` | string | yes | Invoice number |
3309
+ | `invDate` | string | yes | Invoice date (format: yyyy/mm/dd) |
3310
+ | `invCustomer` | 0 \\| 1 | | Customer is not company? Value 1\|0 |
3311
+ | `invRef` | string | yes | 3rd party Bill-ID. Identifies the invoice: a value that already has an invoice resolves to that invoice instead of issuing a new one |
3312
+ | `invRefDate` | string | | Bill date (format: yyyy/mm/dd) |
3313
+ | `billNumber` | string | | Bill number - extend |
3314
+ | `buyerTax` | string | | Buyer tax-number |
3315
+ | `buyerCode` | string | | Buyer-id |
3316
+ | `buyerName` | string | yes | Buyer full name |
3317
+ | `buyerCompany` | string | | Buyer company/ organization name |
3318
+ | `buyerAddress` | string | | Buyer full address |
3319
+ | `buyerAcc` | string | | Buyer bank account number |
3320
+ | `buyerBank` | string | | Buyer bank name |
3321
+ | `buyerEmail` | string | | Buyer email |
3322
+ | `buyerPhone` | string | | Buyer phone number |
3323
+ | `buyerFax` | string | | Buyer fax number |
3324
+ | `buyerCitizenIDNumber` | string | | Citizen Identification Number |
3325
+ | `buyerPassportNumber` | string | | Passport Number |
3326
+ | `govUnitCode` | string | | Budget-related Unit Code |
3327
+ | `invSubTotal` | number | yes | Invoice Subtotal (not include VAT, not include discount) |
3328
+ | `invVatRate` | number | yes | VAT Rate: 0,5,8,10 (0%,5%,8%,10%), -1 (Not taxable), -2 (Not declare and pay taxes) |
3329
+ | `invVatAmount` | number | yes | VAT Amount |
3330
+ | `invTotalAmount` | number | yes | Invoice Total |
3331
+ | `invPayment` | string | | Payment method |
3332
+ | `invExchangeRate` | number | | Exchange rate (to VietNam đồng) |
3333
+ | `invCurrency` | string | | Payment currency |
3334
+ | `note` | string | | Note for discount |
3335
+ | `invAutoSign` | 0 \\| 1 | | Request sign invoice immediately after create successful? Value 1\|0 |
3336
+ | `privateCode` | string | | The UID string (10-12 chars), the buyer will use this code to lookup invoice (after invoice signed). If blank, WinInvoice will generate automatically |
3337
+ | `option` | 0 \\| 1 \\| 2 \\| 3 \\| 4 | | Invoice type: 0 (Normal invoice), 1 (Information-adjustment invoice), 2 (Increases-adjustment invoice), 3 (Decreases-adjustment invoice), 4 (Replacement invoice - original will be marked as deleted when signed) |
3338
+ | `invCodeOld` | string | | Original invoice number (required for adjustment/replacement invoices) |
3339
+ | `invNameOld` | string | | Original invoice sample name (required for adjustment/replacement invoices) |
3340
+ | `invSignOld` | string | | Original invoice sign (required for adjustment/replacement invoices) |
3341
+ | `create04SSHDDT` | 0 \\| 1 | | Auto create 04/SS-HĐĐT? Value 1\|0 (default 1) |
3342
+ | `reason04SSHDDT` | string | | 04/SS-HĐĐT Reason |
3343
+ | `isDscnForSaleInv` | 0 \\| 1 | | Apply an 8% tax reduction to the sales invoice? Value 1\|0 (default 0) |
3344
+ | `saleInvVATRate` | number | | Tax rate based on revenue (Only applicable when isDscnForSaleInv = 1) |
3345
+ | `saleInvDscnAmnt` | number | | The reduction amount determined based on revenue and corresponding tax rate (Only applicable when isDscnForSaleInv = 1) |
3346
+ | `privateNote` | string | | Used for internal notes |
3347
+ | `items` | object[] | yes | Array of item/product in this bill |
3348
+ | `items[].itemNo` | string | | Item number |
3349
+ | `items[].itemCode` | string | | Product/Item code |
3350
+ | `items[].itemName` | string | yes | Name of product |
3351
+ | `items[].itemPromo` | 0 \\| 1 | | Is promotional product (gift)? Value 1\|0 (default 0) |
3352
+ | `items[].isDscnItem` | 0 \\| 1 | | Is the discount line? Value 1\|0 (default 0) |
3353
+ | `items[].itemUnit` | string | | Product Unit |
3354
+ | `items[].itemQuantity` | number | yes | Product quantity |
3355
+ | `items[].itemPrice` | number | yes | Product unit price (not include VAT) |
3356
+ | `items[].itemVatRate` | number | | Product VAT rate |
3357
+ | `items[].itemVatAmnt` | number | | Product VAT Amount |
3358
+ | `items[].itemDscnAmnt` | number | | Product Discount Amount |
3359
+ | `items[].itemAmountNoVat` | number | | Product Amount (not include VAT)(not include item discount) |
3360
+ | `items[].adjustType` | "PRICE" \\| "QTTY" | | Type of adjustment: PRICE (Adjust unit price of item in original invoice), QTTY (Adjust quantity of item in original invoice). This field has effect when value of option field is 2 or 3 |
3361
+ | `items[].itemPack` | string | | Product Lot |
3362
+ | `items[].itemDate` | string | | Product expiration date |
3363
+ | `items[].itemNote` | string | | Product note |
3364
+ | `items[].specialGoodsType` | 0 \\| 1 \\| 2 \\| 3 | | Special category of goods: 0 (Normal item/good), 1 (Cars or motorcycles), 2 (Transportation service), 3 (Transportation services on digital and e-commerce platforms) |
3365
+ | `items[].specialGoodsInfo` | object | | Data requirements for specialized goods based on specialGoodsType |
3366
+ | `items[].specialGoodsInfo.chassisNumb` | string | | Chassis Number (for cars/motorcycles - specialGoodsType = 1) |
3367
+ | `items[].specialGoodsInfo.engineNumb` | string | | Engine Number (for cars/motorcycles - specialGoodsType = 1) |
3368
+ | `items[].specialGoodsInfo.licensePlate` | string | | License plate of the transport vehicle (for transportation service - specialGoodsType = 2) |
3369
+ | `items[].specialGoodsInfo.senderName` | string | | Sender's Name (for shipping service - specialGoodsType = 3) |
3370
+ | `items[].specialGoodsInfo.senderAddress` | string | | Sender's Address (for shipping service - specialGoodsType = 3) |
3371
+ | `items[].specialGoodsInfo.senderTaxCode` | string | | Sender's Tax Code (for shipping service - specialGoodsType = 3) |
3372
+ | `items[].specialGoodsInfo.senderCitizenIDNumber` | string | | Sender's Citizen Identification Number (for shipping service - specialGoodsType = 3) |
3373
+ | `items[].isNoteItem` | 0 \\| 1 | | Is the note line? Value 1\|0 (default 0) |
3374
+ | `connected_account_id` | string | yes | The ID of the connected account |
3375
+
3376
+ **Answer**
3377
+
3378
+ | Name | Type | Required | What it is |
3379
+ | --- | --- | --- | --- |
3380
+ | `oid` | string | yes | WinInvoice's UID |
3381
+ | `invCode` | string | yes | Invoice number (is '0000000' if has not signed) |
3382
+ | `invRef` | string | yes | 3rd party Bill-ID |
3383
+ | `invSign` | string | yes | Invoice sign, (as invSerial) |
3384
+ | `invDate` | string | yes | Invoice date, format yyyy-mm-dd |
3385
+ | `invName` | string | yes | Full invoice sample (invName + invSign) |
3386
+ | `privateCode` | string | yes | Private lookup code for buyer |
3387
+ | `itemTotal` | number | | Count of products in invoice |
3388
+ | `itemError` | number | | Count of error-products in invoice |
3389
+ | `govTranfer` | number | yes | Invoice has transferred to GOV? 1\|0 |
3390
+ | `govTranID` | string | yes | Transaction ID used to transfer invoice to GOV |
3391
+ | `govTranferErr` | number | yes | ansferred to GOV has FAIL? 1\|0 |
3392
+ | `govTranText` | string | yes | Error message if transfer to GOV has FAIL |
3393
+ | `govCode` | string | yes | The UID string issue by GOV for this invoice |
3394
+ | `autoSign` | number | | Has request sign immediately ? 1\|0 |
3395
+ | `isExisting` | 0 \\| 1 | | 1 when invRef already had an invoice and this call returned it unchanged — no invoice was issued |
3396
+ | `link` | string | yes | Link to view the invoice |
3397
+
3398
+ ## word
3399
+
3400
+ ### word_create_document (workflow step)
3401
+
3402
+ - Create a new Word document (.docx), optionally with initial paragraphs and headings.
3403
+ - Use {{variable_name}} syntax in text to create template placeholders for data injection via create_word_template. (workflow step, chat, MCP, CLI)
3404
+ - Input: { filename, content?: [{ type: "paragraph"\|"heading", text, level?: 1-6 }] } filename is without the .docx extension (added automatically).
3405
+
3406
+ **Inputs**
3407
+
3408
+ | Name | Type | Required | What it is |
3409
+ | --- | --- | --- | --- |
3410
+ | `filename` | string | yes | Name of the file (without .docx extension) |
3411
+ | `content` | object[] | | |
3412
+ | `content[].type` | "paragraph" \\| "heading" | yes | |
3413
+ | `content[].text` | string | yes | |
3414
+ | `content[].level` | number | | Heading level (1-6), required when type is heading |
3415
+
3416
+ **Answer**
3417
+
3418
+ | Name | Type | Required | What it is |
3419
+ | --- | --- | --- | --- |
3420
+ | `file_id` | string | yes | The ID of the generated file. |
3421
+ | `url` | string | yes | The download URL of the generated file. |
3422
+ | `filename` | string | yes | The filename of the generated file, including extension. |
3423
+ | `mime_type` | string | yes | The MIME type of the generated file. |
3424
+
3425
+ ### word_find_text (workflow step)
3426
+
3427
+ - Search for text across all paragraphs and table cells in a Word document.
3428
+ - Input: { file_id, query: "search text", match_type?: "contains"\|"exact"\|"regex", max_results?: number } Default match_type is "contains".
3429
+ - Returns matching element indices, types, and text content.
3430
+ - Read-only — does not modify the file.
3431
+
3432
+ **Inputs**
3433
+
3434
+ | Name | Type | Required | What it is |
3435
+ | --- | --- | --- | --- |
3436
+ | `file_id` | string | yes | The ID of the Word (.docx) file |
3437
+ | `query` | string | yes | |
3438
+ | `match_type` | "contains" \\| "exact" \\| "regex" | | |
3439
+ | `max_results` | number | | |
3440
+
3441
+ **Answer**
3442
+
3443
+ | Name | Type | Required | What it is |
3444
+ | --- | --- | --- | --- |
3445
+ | `matches` | object[] | yes | |
3446
+ | `matches[].index` | number | yes | |
3447
+ | `matches[].type` | "paragraph" \\| "table" \\| "other" | yes | |
3448
+ | `matches[].text` | string | yes | |
3449
+ | `total` | number | yes | |
3450
+
3451
+ ### word_get_content (workflow step)
3452
+
3453
+ - Read a Word document's full native content, paginated.
3454
+ - Every element returned is COMPLETE — full paragraph text and full table cells — unlike view_files, whose quick-look preview truncates long paragraphs and tables. (workflow step, chat)
3455
+ - Input: { file_id, offset?, limit? }.
3456
+ - Returns elements with their 0-based indices plus next_offset when more remains; call again with offset=next_offset to continue.
3457
+ - A page may end before `limit` to keep elements whole — follow next_offset, don't infer completion from the count.
3458
+ - A selection mark — a highlighted, shaded or coloured run, or a shaded table cell — surfaces in `marked_text` (the paragraph with each mark shown where it falls, which is what tells you WHICH of two identical `□` was picked), `highlighted_spans` (the marked text alone) and `marked_cells` (per table), so a form's chosen option reads correctly even when it is marked by colour rather than a tick.
3459
+ - Bold is OFF by default and reported only with `include_bold`, as a FACT rather than a selection: nearly every heading and label is bold, so on most documents it is noise.
3460
+ - Reach for it when a form's chosen option carries no glyph and no colour — some forms record the choice by bolding the chosen option's label, and then bold is the tick's only trace.
3461
+ - On a PARAGRAPH, `formatting_hint` already says the line contains bold (it cannot say which run — that is what `bold_spans` adds).
3462
+ - A TABLE carries no such hint, so on a criteria or option table pass `include_bold` rather than waiting for a signal.
3463
+ - Read the result against its siblings: a wholly bold heading or header row is structure, one bold label among plain ones is the choice.
3464
+ - Footnotes surface in `footnote_refs` (per paragraph) and `footnote_cells` (per table) with the note's own text, since a clause often carries its rule in the footnote rather than the sentence.
3465
+ - `orphaned_footnotes` lists notes the file carries with no anchor left in the body — those render nowhere.
3466
+ - Pictures surface in `images` on the element holding them, so a paragraph carrying only a picture is not mistaken for an empty one.
3467
+ - `headers_footers` carries header and footer text, which sits outside the body and so has no element index — a form often states which form it is there rather than in its text.
3468
+ - Read-only — does not modify the file.
3469
+
3470
+ **Inputs**
3471
+
3472
+ | Name | Type | Required | What it is |
3473
+ | --- | --- | --- | --- |
3474
+ | `file_id` | string | yes | The ID of the Word (.docx) file |
3475
+ | `offset` | integer | | Element index to start from (pass the prior call's next_offset) |
3476
+ | `limit` | integer | | Max elements to return |
3477
+ | `include_bold` | boolean | | Also report WHERE the bold runs are (bold_spans / bold_cells). Off unless asked for — nearly every heading and label is bold, so it is noise on most documents and the answer on a form that ticks by bolding. |
3478
+
3479
+ **Answer**
3480
+
3481
+ | Name | Type | Required | What it is |
3482
+ | --- | --- | --- | --- |
3483
+ | `elements` | object[] | yes | |
3484
+ | `elements[].index` | number | yes | |
3485
+ | `elements[].type` | "paragraph" \\| "table" \\| "other" | yes | |
3486
+ | `elements[].text` | string | | |
3487
+ | `elements[].rows` | number | | |
3488
+ | `elements[].cols` | number | | |
3489
+ | `elements[].cells` | string[][] | | |
3490
+ | `elements[].heading_level` | number | | |
3491
+ | `elements[].list_type` | "bullet" \\| "numbered" | | |
3492
+ | `elements[].list_level` | number | | |
3493
+ | `elements[].formatting_hint` | string | | |
3494
+ | `elements[].highlighted_spans` | string[] | | |
3495
+ | `elements[].bold_spans` | string[] | | |
3496
+ | `elements[].marked_text` | string | | |
3497
+ | `elements[].images` | object[] | | |
3498
+ | `elements[].images[].name` | string | | |
3499
+ | `elements[].images[].width_cm` | number | | |
3500
+ | `elements[].images[].height_cm` | number | | |
3501
+ | `elements[].marked_cells` | object[] | | |
3502
+ | `elements[].marked_cells[].row` | number | yes | |
3503
+ | `elements[].marked_cells[].col` | number | yes | |
3504
+ | `elements[].marked_cells[].spans` | string[] | yes | |
3505
+ | `elements[].bold_cells` | object[] | | |
3506
+ | `elements[].bold_cells[].row` | number | yes | |
3507
+ | `elements[].bold_cells[].col` | number | yes | |
3508
+ | `elements[].bold_cells[].spans` | string[] | yes | |
3509
+ | `elements[].footnote_refs` | object[] | | |
3510
+ | `elements[].footnote_refs[].mark` | number | yes | The superscript number the reader sees |
3511
+ | `elements[].footnote_refs[].id` | string | yes | |
3512
+ | `elements[].footnote_refs[].offset` | number | yes | Character offset into this element's text where the mark sits |
3513
+ | `elements[].footnote_refs[].text` | string | | |
3514
+ | `elements[].footnote_cells` | object[] | | |
3515
+ | `elements[].footnote_cells[].row` | number | yes | |
3516
+ | `elements[].footnote_cells[].col` | number | yes | |
3517
+ | `elements[].footnote_cells[].refs` | object[] | yes | |
3518
+ | `elements[].footnote_cells[].refs[].mark` | number | yes | The superscript number the reader sees |
3519
+ | `elements[].footnote_cells[].refs[].id` | string | yes | |
3520
+ | `elements[].footnote_cells[].refs[].offset` | number | yes | Character offset into this element's text where the mark sits |
3521
+ | `elements[].footnote_cells[].refs[].text` | string | | |
3522
+ | `total` | number | yes | |
3523
+ | `next_offset` | number \\| null | yes | |
3524
+ | `orphaned_footnotes` | object[] | | Notes the file still carries with no anchor left in the body — they render nowhere |
3525
+ | `orphaned_footnotes[].id` | string | yes | |
3526
+ | `orphaned_footnotes[].text` | string | yes | |
3527
+ | `headers_footers` | object[] | | Header and footer text — outside the body, so it carries no element index |
3528
+ | `headers_footers[].kind` | "header" \\| "footer" | yes | |
3529
+ | `headers_footers[].text` | string | yes | |
3530
+
3531
+ ### word_get_table_data (workflow step)
3532
+
3533
+ - Read the full contents of a table in a Word document as a 2D string array.
3534
+ - Input: { file_id, table_index: number, max_rows? } table_index is the 0-based element index from view_files (must point to a table element). (workflow step, chat)
3535
+ - Returns data[][] with row_count and col_count.
3536
+ - A cell carrying a selection mark — a highlighted or shaded run, or a shaded cell — is listed in `marked_cells` ({row, col} aligned with data, spans = the marked text; empty spans = a shaded blank), so a criteria row's chosen option reads correctly even when it is marked by colour rather than a tick.
3537
+ - `bold_cells` lists the bold cells the same way, but ONLY with `include_bold` — header rows and label columns are bold, so it is noise on most tables.
3538
+ - Nothing in the default output hints that a table contains bold, so pass it whenever a criteria or option table shows no glyph and no colour: some forms record the choice by bolding that row's label and it is the tick's only trace.
3539
+ - It is a fact, never a selection — a whole bold header row is structure, one bold label among plain siblings is the choice.
3540
+ - Read-only — does not modify the file.
3541
+
3542
+ **Inputs**
3543
+
3544
+ | Name | Type | Required | What it is |
3545
+ | --- | --- | --- | --- |
3546
+ | `file_id` | string | yes | The ID of the Word (.docx) file |
3547
+ | `table_index` | number | yes | 0-based element index of the table |
3548
+ | `max_rows` | number | | Max rows to return; all rows when omitted |
3549
+ | `include_bold` | boolean | | Also report which cells are bold (bold_cells). Off unless asked for — header rows and label columns are bold, so it is noise on most tables and the answer on one that ticks by bolding. |
3550
+
3551
+ **Answer**
3552
+
3553
+ | Name | Type | Required | What it is |
3554
+ | --- | --- | --- | --- |
3555
+ | `data` | string[][] | yes | |
3556
+ | `row_count` | number | yes | |
3557
+ | `col_count` | number | yes | |
3558
+ | `marked_cells` | object[] | | |
3559
+ | `marked_cells[].row` | number | yes | |
3560
+ | `marked_cells[].col` | number | yes | |
3561
+ | `marked_cells[].spans` | string[] | yes | |
3562
+ | `bold_cells` | object[] | | |
3563
+ | `bold_cells[].row` | number | yes | |
3564
+ | `bold_cells[].col` | number | yes | |
3565
+ | `bold_cells[].spans` | string[] | yes | |
3566
+
3567
+ ### word_insert_conditional (workflow step)
3568
+
3569
+ - Insert {{IF variable_name}}...{{END-IF variable_name}} command rows or paragraphs into a Word document to define a conditional section.
3570
+ - For table_rows: wraps the specified row range with command rows.
3571
+ - Requires table_index, start_row, end_row.
3572
+ - For paragraphs: wraps the specified element range with command paragraphs.
3573
+ - Requires start_index, end_index.
3574
+ - Use view_files to find element indices first. (workflow step, chat)
3575
+
3576
+ **Inputs**
3577
+
3578
+ | Name | Type | Required | What it is |
3579
+ | --- | --- | --- | --- |
3580
+ | `file_id` | string | yes | |
3581
+ | `variable_name` | string | yes | Boolean variable name |
3582
+ | `region_type` | "table_rows" \\| "paragraphs" | yes | |
3583
+ | `table_index` | integer | | Index of the table element (required for table_rows) |
3584
+ | `start_row` | integer | | First row to wrap (required for table_rows) |
3585
+ | `end_row` | integer | | Last row to wrap, inclusive (required for table_rows) |
3586
+ | `start_index` | integer | | First element index to wrap (required for paragraphs) |
3587
+ | `end_index` | integer | | Last element index to wrap, inclusive (required for paragraphs) |
3588
+
3589
+ **Answer**
3590
+
3591
+ | Name | Type | Required | What it is |
3592
+ | --- | --- | --- | --- |
3593
+ | `file_id` | string | yes | |
3594
+
3595
+ ### word_insert_loop (workflow step)
3596
+
3597
+ - Insert {{FOR loop_var IN variable_name}}...{{END-FOR loop_var}} command rows or paragraphs into a Word document to define a repeating section.
3598
+ - Inside the loop, reference each item's fields with a $ prefix: {{$loop_var.field}} (or {{$loop_var}} for a scalar item, {{$idx}} for the 0-based index).
3599
+ - Without the $ prefix, generation fails.
3600
+ - For table_rows: wraps the specified row range with command rows.
3601
+ - Requires table_index, start_row, end_row.
3602
+ - For paragraphs: wraps the specified element range with command paragraphs.
3603
+ - Requires start_index, end_index.
3604
+ - Use view_files to find element indices first. (workflow step, chat)
3605
+
3606
+ **Inputs**
3607
+
3608
+ | Name | Type | Required | What it is |
3609
+ | --- | --- | --- | --- |
3610
+ | `file_id` | string | yes | |
3611
+ | `variable_name` | string | yes | Array variable name |
3612
+ | `loop_variable` | string | yes | Iterator name used inside the loop, e.g. item |
3613
+ | `region_type` | "table_rows" \\| "paragraphs" | yes | |
3614
+ | `table_index` | integer | | Index of the table element (required for table_rows) |
3615
+ | `start_row` | integer | | First row to wrap (required for table_rows) |
3616
+ | `end_row` | integer | | Last row to wrap, inclusive (required for table_rows) |
3617
+ | `start_index` | integer | | First element index to wrap (required for paragraphs) |
3618
+ | `end_index` | integer | | Last element index to wrap, inclusive (required for paragraphs) |
3619
+
3620
+ **Answer**
3621
+
3622
+ | Name | Type | Required | What it is |
3623
+ | --- | --- | --- | --- |
3624
+ | `file_id` | string | yes | |
3625
+
3626
+ ### word_replace_text (workflow step)
3627
+
3628
+ - Find and replace text across all paragraphs and table cells in a Word document.
3629
+ - Replaces all occurrences unless max_replacements is set.
3630
+ - A match spanning several runs collapses them into the first run's formatting, so tick a checkbox by matching the box character on its own — ☐ (U+2610) becomes ☒ (U+2612), keeping the font that draws both.
3631
+ - Matching the phrase around the box drags it into the body font; replacing it with a letter leaves a bare letter beside the boxes still showing ☐.
3632
+
3633
+ **Inputs**
3634
+
3635
+ | Name | Type | Required | What it is |
3636
+ | --- | --- | --- | --- |
3637
+ | `file_id` | string | yes | The ID of the Word (.docx) file |
3638
+ | `find` | string | yes | |
3639
+ | `replace` | string | yes | |
3640
+ | `match_type` | "contains" \\| "exact" \\| "regex" | | `exact` matches a whole paragraph. None of the three is case-sensitive. |
3641
+ | `max_replacements` | number | | Max number of replacements (default: unlimited) |
3642
+
3643
+ **Answer**
3644
+
3645
+ | Name | Type | Required | What it is |
3646
+ | --- | --- | --- | --- |
3647
+ | `file_id` | string | yes | |
3648
+ | `replacements_made` | number | yes | |
3649
+
3650
+ ## x
3651
+
3652
+ ### x_create_post (workflow step)
3653
+
3654
+ - Publish a post to the connected X account.
3655
+
3656
+ **Inputs**
3657
+
3658
+ | Name | Type | Required | What it is |
3659
+ | --- | --- | --- | --- |
3660
+ | `connected_account_id` | string | yes | |
3661
+ | `text` | string | yes | |
3662
+ | `media_file_ids` | string[] | | Up to 4 images, or one GIF, or one video. |
3663
+
3664
+ **Answer**
3665
+
3666
+ | Name | Type | Required | What it is |
3667
+ | --- | --- | --- | --- |
3668
+ | `post_id` | string | yes | |
3669
+ | `url` | string | yes | |
3670
+
3671
+ ## zip
3672
+
3673
+ ### zip_files (workflow step)
3674
+
3675
+ - Bundle multiple files into a zip archive.
3676
+ - Max 100 files.
3677
+ - An item in file_ids is a file id — or `{ id, name }` to name that entry in the archive: a file name, never a path, carrying the stored extension.
3678
+ - A bare id keeps the stored filename.
3679
+
3680
+ **Inputs**
3681
+
3682
+ | Name | Type | Required | What it is |
3683
+ | --- | --- | --- | --- |
3684
+ | `file_ids` | string \\| object[] | yes | |
3685
+ | `filename` | string | | Name for the zip file, without the .zip extension. |
3686
+
3687
+ **Answer**
3688
+
3689
+ | Name | Type | Required | What it is |
3690
+ | --- | --- | --- | --- |
3691
+ | `file_id` | string | yes | The ID of the generated file. |
3692
+ | `url` | string | yes | The download URL of the generated file. |
3693
+ | `filename` | string | yes | The filename of the generated file, including extension. |
3694
+ | `mime_type` | string | yes | The MIME type of the generated file. |