Skip to content

Custom integrations

A custom integration runs JavaScript you write, called hooks, inside Flowstate:

  • PULL hooks fetch records from another system, on a schedule or on demand, and create, update or delete Flowstate records to match.
  • PUSH hooks run when a record changes in Flowstate and send the change to another system.

Switched on per organisation

Flowstate switches custom integrations on for each organisation. Ask your Flowstate contact.

Choose an approach

REST APIWebhooksCustom integration
Who runs the codeYouYouFlowstate
What you hostA clientAn endpoint Flowstate can reachNothing
DirectionYour system reads and writes FlowstateFlowstate notifies your endpointPULL: other system to Flowstate. PUSH: Flowstate to other system.
Triggered byYour codeA change in live dataPULL: a schedule or Trigger Now. PUSH: a change in live data.
ScenariosRead and writeEvents on merge onlyPULL writes live data. PUSH runs on merge.
On failureYour code retriesNot retriedNot retried
  • Custom integration: the other system has an HTTP API that Flowstate can reach over the internet, the data fits the supported entity types, the volume fits the limits, and you don't want to host a service.
  • REST API: anything else, including scenarios, entity types hooks don't cover, and volumes beyond the limits.
  • Webhooks: feeding a service you already run, as changes happen.

Deciding where people data should live and how it should flow: People data. A worked HR system sync: Sync an HR system.

How it fits together

PartDescription
IntegrationCredentials and hooks for one other system. Its Source System Key identifies that system, is unique in the organisation, and can't be changed. PULL hooks match records on this key and each record's externalId.
CredentialA secret your code reads as ctx.secrets.KEY. Stored encrypted. The value isn't shown again after saving.
HookA PULL or PUSH function for one entity type. Neither can be changed after the hook is created. A new hook is switched off.
ExecutionOne run of a hook: status, trigger, duration, record counts, log entries, HTTP requests and any error.

Creating integrations, storing credentials, scheduling and switching hooks on: Manage a custom integration.

Supported entity types

Entity typePULL writesPUSH receives
employeeEmployees, with team and project allocations and salary adjustmentsEmployee changes
contractorContractors, with team and project allocations and rate adjustmentsContractor changes
vacancyVacancies, with team and project allocations and who fills themVacancy changes
projectProjectsProject changes
teamTeams, with parent and managerTeam changes
assignmentAn employee's allocation to a projectChanges to any employee, contractor or vacancy allocation to a team or project
functional_groupAreas in the functional structureArea changes
functional_positionSeats in an areaSeat changes
functional_assignmentA person's time in a seatAssignment changes

Fields for each: Data model.

Limits

LimitPULLPUSH
JavaScript execution time30 seconds per page10 seconds per run
Memory128 MB128 MB
HTTP requests50 per page50 per run
Timeout per HTTP request60 seconds60 seconds
HTTP response size10 MB10 MB
Pages per run100
ctx.kv key length256 characters256 characters
ctx.kv value size64 KB64 KB
ctx.kv default expiry90 days90 days
  • Going over the execution time or memory fails the run.
  • An HTTP request over the limit, a response over 10 MB, and a key or value over its limit each throw inside your code.
  • At 100 pages, a PULL run stops with a warning and completes.

Events from hook writes

PULL hook writes toSends webhooks and triggers PUSH hooks
employee, contractor, vacancy, project, team, assignmentNo
functional_group, functional_position, functional_assignmentYes, with initiator.type user and the integration's creator as initiator.id

If a PUSH hook writes to a system that a PULL hook reads, guard against loops for the functional structure.

Next steps

Flowstate Documentation