ExampleTemplate
Permit pipeline: map issued, report finaled, file expired
Nightly, reads changed permits with a SQL query, cleans and checks them, then puts issued permits on the ArcGIS map, emails building a total of finaled permits by type, and writes expired permits to a CSV file on SFTP.
This flow
12 steps
StartsOn a schedule
SystemsPostgreSQL / PostGIS, Esri ArcGIS feature layer, SFTP server
Branches4
Stored recordsNone: pass-through
§ The flow
The whole flow, as it appears on the canvas.
Scroll sideways on small screens. Colors show the kind of step: start, read, change, decide, write.
§ Step by step
What each step does.
- 01 · Start · On a schedule
Nightly at 2 am
- Every night at 2:00 am (workspace time zone)
Then: Changed permits
- 02 · Database · Read database · PostgreSQL / PostGIS
Changed permits
- Reads from PostgreSQL / PostGIS with a read-only query
SELECT permit_number, permit_type, status, address, applicant, valuation, issued_on, ST_Y(geom) AS lat, ST_X(geom) AS lng, updated_at FROM permits WHERE updated_at > COALESCE(CAST(:last_success_at AS timestamptz), '1970-01-01') ORDER BY updated_at- Row ID column:
permit_number(used for replay and lineage)
Then: Clean and check
- 03 · Change · Apply rules
Clean and check
permit_type: titlestatus: lowerstatus: one ofissued, finaled, in review, expiredvaluation: numberapplicant: required- Records that fail a check are dropped
Then: Issued?
- 04 · Decide · If / else
Issued?
- Yes when
statusisissued
Then: Yes → Map attributes; No → Finaled?
- Yes when
- 05 · Change · Map fields
Map attributes
- Shapes each record into 6 fields:
ref,status,address,type,lat,lng
Then: Make map point
- Shapes each record into 6 fields:
- 06 · Decide · If / else
Finaled?
- Yes when
statusisfinaled
Then: Yes → Total by type; No → Expired?
- Yes when
- 07 · Database · Make map point
Make map point
- Builds an ArcGIS map point from
latandlng - Drops records without coordinates
Then: Add to the permit map
- Builds an ArcGIS map point from
- 08 · Change · Summarize
Total by type
- Counts records by
permit_typeand adds upvaluation
Then: Email building
- Counts records by
- 09 · Decide · If / else
Expired?
- Yes when
statusisexpired
Then: Yes → Expired permits to SFTP
- Yes when
- 10 · Write · Send records · Esri ArcGIS feature layer
Add to the permit map
- Creates Features in Esri ArcGIS feature layer
- 11 · Act · Send email
Email building
- Emails
[email protected]: “Permits finaled last night” - One summary email
- Emails
- 12 · Files · Write file · SFTP server
Expired permits to SFTP
- Writes CSV file
expired-permits-{{ $today }}.csvtooutbox - One file with every record
- Writes CSV file
§ Systems
Connectors used
Swap any of them for another system with the same kind of data.
Run this flow on your systems.
We'll set up a workspace with your systems in a sandbox and build your first flow with you.