Skip to content

AdHoc ​

Finds and updates the brokerage firm’s clients in AdHoc (Custy), reads policies, claims and premium notices, reports a claim, creates a task, files or fetches a stored document.

The AdHoc node connects a brokerage firm’s mailbox to AdHoc, its management software (Custy): find the policyholder who writes, their policies, claims and premium notices, report a claim, hand the file to an account manager with a task, and file or send back documents from the document store.

See AdHoc to create the connection.

At a glance ​

  • Type: adhoc.api · version 1
  • Category: Data
  • Kind: Step — one stage of a run
  • Effect: Writes outside (external_write) — writes outside Loop & Roll; described instead of performed during a test run
  • Needs a carrier email: No
  • Connection: AdHoc
  • Inputs: main
  • Outputs: main
The ports of “AdHoc”: what comes in on the left, what goes out on the rightInput: main. Outputs: main. An error output appears when its failure setting is “Follow the Error output”. It needs a AdHoc connection.AdHocadhoc.apimainmainerror · only with “Follow the Error output”Connection: AdHoc
The ports of “AdHoc”: what comes in on the left, what goes out on the right

Connection ​

This node needs a AdHoc connection.

Parameters ​

connection ​

AdHoc connection — The AdHoc connection to use. Create it once in Connections; its key never appears in the workflow.

  • Type: Connection (credential)
  • Required: Yes
  • Default: "" (empty)

action ​

Action

  • Type: One choice (options)
  • Required: Yes
  • Default: client.find
  • Options:
    • client.find — Find a client: By name, email address, phone or SIRET.
    • client.get — Get a client
    • client.create — Create a client
    • client.update — Update a client: Only the filled-in fields are sent.
    • contact.create — Add a contact to a client
    • contract.list — List policies: Of a client, or by insurer reference.
    • contract.get — Get a policy
    • claim.list — List claims: Of a client or a policy.
    • claim.get — Get a claim
    • claim.create — Report a claim
    • claim.update — Update a claim: Only the filled-in fields are sent.
    • receipt.list — List premium notices: Of a client or a policy.
    • task.create — Create a task
    • document.list — List stored documents
    • document.download — Fetch a stored document: Adds it to the run’s attachments.
    • document.upload — File attachments in the document store: On a client, a policy or a claim.

searchName ​

Last or first name — Last name, first name or both. Start with % for “starts with”.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Shown when: action is client.find
  • Expressions: {{ }} accepted

searchEmail ​

Email address

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 120 characters at most
  • Example: {{ email.from.email }}
  • Shown when: action is client.find
  • Expressions: {{ }} accepted

searchPhone ​

Phone (landline or mobile)

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 30 characters at most
  • Shown when: action is client.find
  • Expressions: {{ }} accepted

searchSiret ​

SIRET

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is client.find
  • Expressions: {{ }} accepted

clientCode ​

Client code — The AdHoc client code ({{ data.<step>.client.code }}). Optional for a list or a task.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is one of client.get, client.update, contact.create, contract.list, claim.list, receipt.list, task.create
  • Expressions: {{ }} accepted

companyReference ​

Insurer policy reference

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 60 characters at most
  • Shown when: action is contract.list
  • Expressions: {{ }} accepted

contractCode ​

Policy code (internal) — The AdHoc internal policy code. Required to get a policy or report a claim.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is one of contract.get, claim.create, claim.list, receipt.list, task.create
  • Expressions: {{ }} accepted

claimCode ​

Claim code

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is one of claim.get, claim.update, task.create
  • Expressions: {{ }} accepted

limit ​

Maximum count

  • Type: Number (number)
  • Required: No
  • Default: 20
  • Whole number, from 1 to 100
  • Shown when: action is one of client.find, contract.list, claim.list, receipt.list

lastName ​

Last name or company name

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 60 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

firstName ​

First name

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 40 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

street ​

Address (street)

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 60 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

postalCode ​

Postal code

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 10 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

city ​

City

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 40 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

email ​

Email address

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 60 characters at most
  • Example: {{ email.from.email }}
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

phone ​

Phone

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

mobile ​

Mobile phone

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

clientType ​

Client type

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.clientType)
  • Listed with the connection in: connection
  • Shown when: action is one of client.create, client.update

clientSubType ​

Client subtype — Required to create a client.

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.clientSubType)
  • Listed inside: clientType
  • Listed with the connection in: connection
  • Shown when: action is one of client.create, client.update

clientNature ​

Client nature — Required to create a client.

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.clientNature)
  • Listed with the connection in: connection
  • Shown when: action is one of client.create, client.update

clientStatus ​

Status

  • Type: One choice (options)
  • Required: No
  • Default: "" (empty)
  • Options:
    • — Unchanged (AdHoc default)
    • 1 — Client
    • 2 — Prospect
    • 3 — Inactive prospect
    • 4 — Lead
  • Shown when: action is one of client.create, client.update

clientNotes ​

Notes — Replaces the record’s notes.

  • Type: Long text (text)
  • Required: No
  • Default: "" (empty)
  • 5000 characters at most
  • Shown when: action is one of client.create, client.update
  • Expressions: {{ }} accepted

contactLastName ​

Contact last name

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 60 characters at most
  • Shown when: action is contact.create
  • Expressions: {{ }} accepted

contactFirstName ​

Contact first name

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 30 characters at most
  • Shown when: action is contact.create
  • Expressions: {{ }} accepted

contactFunction ​

Role

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.contactFunction)
  • Listed with the connection in: connection
  • Shown when: action is contact.create

contactEmail ​

Email address

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 60 characters at most
  • Example: {{ email.from.email }}
  • Shown when: action is contact.create
  • Expressions: {{ }} accepted

contactPhone ​

Phone

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is contact.create
  • Expressions: {{ }} accepted

contactMobile ​

Mobile phone

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is contact.create
  • Expressions: {{ }} accepted

occurredOn ​

Date of loss — As YYYY-MM-DD or DD/MM/YYYY.

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 30 characters at most
  • Shown when: action is claim.create
  • Expressions: {{ }} accepted

declaredOn ​

Report date — As YYYY-MM-DD or DD/MM/YYYY. Empty: today.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 30 characters at most
  • Shown when: action is claim.create
  • Expressions: {{ }} accepted

claimNature ​

Claim type

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.claimNature)
  • Listed with the connection in: connection
  • Shown when: action is claim.create

circumstances ​

Circumstances

  • Type: Long text (text)
  • Required: No
  • Default: "" (empty)
  • 5000 characters at most
  • Example: {{ email.bodyText }}
  • Shown when: action is one of claim.create, claim.update
  • Expressions: {{ }} accepted

clientReference ​

Client reference

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 60 characters at most
  • Shown when: action is one of claim.create, claim.update
  • Expressions: {{ }} accepted

insurerClaimReference ​

Insurer reference

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 40 characters at most
  • Shown when: action is one of claim.create, claim.update
  • Expressions: {{ }} accepted

manager ​

Claims handler

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.user)
  • Listed with the connection in: connection
  • Shown when: action is one of claim.create, claim.update

claimNotes ​

Notes

  • Type: Long text (text)
  • Required: No
  • Default: "" (empty)
  • 5000 characters at most
  • Shown when: action is one of claim.create, claim.update
  • Expressions: {{ }} accepted

subject ​

Subject

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 150 characters at most
  • Example: {{ email.subject }}
  • Shown when: action is task.create
  • Expressions: {{ }} accepted

dueOn ​

Task date — As YYYY-MM-DD or DD/MM/YYYY. Empty: today.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 30 characters at most
  • Shown when: action is task.create
  • Expressions: {{ }} accepted

assignee ​

Assigned to

  • Type: Remote resource (resourceLocator)
  • Required: No
  • Ways to choose: pick from a list, type an ID (adhoc.user)
  • Listed with the connection in: connection
  • Shown when: action is task.create

priority ​

Priority

  • Type: One choice (options)
  • Required: No
  • Default: 2
  • Options:
    • 1 — Low
    • 2 — Normal
    • 3 — High
  • Shown when: action is task.create

taskNotes ​

Notes

  • Type: Long text (text)
  • Required: No
  • Default: "" (empty)
  • 5000 characters at most
  • Shown when: action is task.create
  • Expressions: {{ }} accepted

documentTarget ​

Record

  • Type: One choice (options)
  • Required: No
  • Default: client
  • Options:
    • client — A client
    • contract — A policy
    • claim — A claim
  • Shown when: action is one of document.list, document.upload

entityCode ​

Record code — The client code, internal policy code or claim code.

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is one of document.list, document.upload
  • Expressions: {{ }} accepted

documentId ​

Document (ID) — The ID returned by “List stored documents” ({{ data.<step>.documents.0.id }}).

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 20 characters at most
  • Shown when: action is document.download
  • Expressions: {{ }} accepted

subfolder ​

Subfolder — Optional; levels separated by /.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Shown when: action is document.upload
  • Expressions: {{ }} accepted

description ​

Description

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: {{ email.subject }}
  • Shown when: action is document.upload
  • Expressions: {{ }} accepted

visibleWeb ​

Visible on the web space

  • Type: Yes / no (boolean)
  • Required: No
  • Default: false
  • Shown when: action is document.upload

selection ​

Attachments to use

  • Type: One choice (options)
  • Required: Yes
  • Default: all
  • Options:
    • all — All attachments: Those of the triggering email, then the files added by earlier steps (a fetched deed, a signed PDF), in that order.
    • first — The first one only: The first attachment, when only one matters.
    • byMime — By file type: By MIME type: application/pdf, or a whole family with image/*.
    • byName — By file name: By name pattern: *.pdf, invoice-*.
  • Shown when: action is document.upload

mime ​

File type — Exact MIME type (application/pdf) or a whole family (image/*). Left empty, no attachment is kept.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: application/pdf
  • Shown when: action is document.upload and selection is byMime
  • Expressions: {{ }} accepted

namePattern ​

File name — Simple pattern: * matches anything, ? one character (*.pdf, invoice-*). Case is ignored.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: *.pdf
  • Shown when: action is document.upload and selection is byName
  • Expressions: {{ }} accepted

Outputs ​

  • main — Taken once the call to AdHoc succeeds, whatever the action. An error response from AdHoc fails the step instead.

Data produced ​

What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).

  • {{ data.<step>.client }} — { code, name, firstName, email, phone, mobile, street, postalCode, city, status, createdAt, updatedAt, record }. Find a client: the first match (null otherwise). Get, create, update a client: the record. record is the full record, without social security number or bank details.
  • {{ data.<step>.clientCode }} — string. Find, create or update a client: the AdHoc code, to pass to the other actions.
  • {{ data.<step>.clients }} — array. Find a client: the matching records, one hundred at most (with count, total and truncated).
  • {{ data.<step>.contracts }} — array of { code, companyReference, clientCode, clientName, companyCode, branch, category, status, premium, effectiveDate, endDate, nextRenewal, createdAt, updatedAt, record }. List policies. Get a policy returns contract.
  • {{ data.<step>.claims }} — array of { code, clientCode, contractCode, nature, status, occurredAt, declaredAt, companyReference, clientReference, manager, estimatedAmount, circumstances, createdAt, updatedAt, record }. List claims. Get, report or update a claim returns claim and claimCode.
  • {{ data.<step>.receipts }} — array of { id, number, subNumber, clientCode, contractCode, periodStart, periodEnd, accountingDate, premiumInclTax, commission, paymentStatus, status, record }. List premium notices.
  • {{ data.<step>.found }} — boolean. Find or get: true when AdHoc knows the record.
  • {{ data.<step>.taskId }} — string. Create a task: the task ID (with task).
  • {{ data.<step>.documents }} — array of { id, name, folder, description, createdAt, updatedAt, visibleWeb }. List stored documents: the files, two hundred at most. File attachments: the documents created.
  • {{ data.<step>.attachmentPosition }} — number. Fetch a stored document: the position of the file added to the run, to cite in Compose.
  • {{ data.<step>.simulated }} — boolean. Write actions: true in a test, where the write is described without being made.
  • {{ data.<step>.summary }} — string. The one-line summary in the member’s language (with summaryKey and summaryParams).

Operations ​

The node has a single Action parameter (action):

  • Clients — Find a client (client.find, the default) by name (% first for “starts with”), email address, phone or SIRET; Get a client (client.get) by its code; Create a client (client.create: name, street, postal code, city, subtype and nature required); Update a client (client.update: only the filled-in fields); Add a contact to a client (contact.create: name and role required).
  • Policies — List policies (contract.list) of a client or by insurer reference; Get a policy (contract.get) by its internal code.
  • Claims — List claims (claim.list) of a client or a policy; Get a claim (claim.get); Report a claim (claim.create: policy, date of loss and type required, report date today by default); Update a claim (claim.update: circumstances, references, handler, notes).
  • List premium notices (receipt.list) of a client or a policy.
  • Create a task (task.create): subject, date (today by default), assigned user, priority, linked to a client, a policy or a claim.
  • Document store — List stored documents (document.list) of a client, a policy or a claim; Fetch a stored document (document.download) into the run’s attachments (10 MB at most); File attachments in the document store (document.upload).

Dates are entered as YYYY-MM-DD or DD/MM/YYYY; client type, subtype and nature, contact role, claim type and users are picked from lists read in AdHoc. Lists return one hundred items at most, in a single page.

Example ​

A policyholder reports water damage by email. A read step extracted the policy code and the date; a claim node reports the claim, then a store node files the attached photos on it:

text
action          claim.create
contractCode    {{ data.read.policy_code }}
occurredOn      {{ data.read.loss_date }}
circumstances   {{ email.bodyText }}

Tips ​

  • Tests. Reads really run in a test; creations, updates and filings are described without being made.
  • Sensitive data. Social security numbers, IBANs and file contents are never returned in the step data.
  • Slowness. The AdHoc server cuts off at 90 seconds: prefer precise lookups (email address, code) to large lists.
  • Errors. integration.unauthorized: credentials refused, fix the connection. integration.not_found: the code matches nothing. integration.unavailable is retried automatically. An empty required parameter or an unreadable date fails the step with node_invalid_param, before any call. See Error handling.

Loop & Roll — the workflow builder for email.