Released docs. You are viewing the documentation published with v0.48.0. Development docs are available at Latest.
If you ingest survey submissions into a registry with the Registry Adapter, a job pack is the reviewed,
reusable description of how to read the source.
Each maintained job pack acquires submissions one page per route run and returns the item contract
{items: [{key, revision, value}], next}.
No pack carries compiled knowledge, writes, or a delete or patch endpoint.
This page describes the two maintained packs: KoboToolbox and ODK Central.
Ingestion job sources describes the generic source types,
and Operate the Adapter runs a job over a pack.
KoboToolbox pack
Section titled “KoboToolbox pack”The maintained KoboToolbox pack has synthetic fixture coverage.
No run record is published, so testedVersions is unverified until your own pilot repeats a run
against your server.
Treat any compatibility with a production deployment or a server upgrade as unproved.
What the route reads
Section titled “What the route reads”The route reads the v2 submissions listing, GET /api/v2/assets/{uid}/data/, one page per run.
The v2 API renamed the v1 submissions path to data.
The reply envelope is {count, next, previous, results}; the route reads results only and never
follows the reply’s next URL.
The read order is pinned rather than left to the server default.
Every send carries sort={"_id":1} and limit=100 (the documented default page size).
Past the first run it also carries the keyset filter query={"_id":{"$gt":<afterId>}}, built from the
job cursor.
The sort and MongoDB-syntax query parameters are documented in the
KoboToolbox API documentation, and _id is the integer
submission id the server sorts on by default.
A submission only ever gains a larger _id than every earlier one, so the keyset neither skips nor
repeats rows when submissions arrive between runs, where a start offset would shift.
The resumption cursor is the pack’s own {afterId} object:
- A page with submissions, full or short, hands out the
_idof its last submission. - An empty page hands the incoming cursor back unchanged, so the
ongoingscan holds its place at the tail and the next pass reads only what arrived since. - A first run over a form with no submissions hands out no cursor, because there is no position to keep.
A reply whose _id values do not climb past the cursor (a server that ignored sort or query) fails
the run rather than hand out a position that would skip or repeat submissions.
The route declares nextRecovery: key-deduplicated as the documented fallback.
The asset a job reads is a deployment value.
A source route carries no template parameters, so the runtime configuration binds the kobo-api
endpoint’s baseUrl to the data URL of your own asset (origin plus base path), and the pack sends
path: /, which lands on the documented trailing slash.
The kobotoolbox-job example
shows the binding in job-runtime.example.yaml.
Authentication
Section titled “Authentication”KoboToolbox authenticates API requests with an API token over Authorization: Token <token>, or with
Basic auth over TLS.
An endpoint declares one kind, so the pack declares static-authorization with scheme: Token, and
the runtime configuration binds the personal API token through tokenRef.
The API token cannot sign in to the Kobo web UI, but it is not read-only: it carries the account’s API
rights, so bind the token of an account restricted to the form.
A Kobo password also signs in to the web UI, so a leaked password is a full account login.
A deployment that must use Basic swaps the endpoint kind to basic and binds usernameRef and
passwordRef; both sides of the kind match move together.
The endpoint declares no request or response header allowlists, because the documented read consumes no
header the engine would copy.
A refused credential never reaches the route: the engine’s authentication plan raises the
uncatchable credential.rejected on a 401 under a static kind.
Item mapping
Section titled “Item mapping”keyis the submission’s_id, as text, scoped to one configured asset.revisionis the submission’s_uuid. Edits keep_idandmeta/rootUuidstable while changing_uuid. A job does not switch its identity selector after delivery; existing effects need reconciliation before an identity migration.valueis the submission object with its slash-separated group and repeat names nested into objects._validation_statuspasses through only insidevalue, read-only.
Kobo returns group answers as flat names such as household/household_size.
The item value carries them as household: {household_size: ...}, so a job projection addresses them
as household.household_size, because the projection grammar has no escape for a slash inside a member
name.
Rows of a repeat group arrive with their full names (household/member/member_name); each row drops
its repeat’s own name before nesting.
A submission without an integer _id or without _uuid fails the page rather than producing a weaker
item.
So does a name that is both an answer and a group (household and household/x in one submission),
because nesting would have to drop one of them.
The route shapes one submission per script call (a split over results), so a wide form never shares
one script budget with the whole page.
Limits to plan for
Section titled “Limits to plan for”The maintained pack rests on these observations from a controlled run with synthetic data. Verify each against your own server and form before you rely on it:
- Submission
_idvalues were unique, and an authenticated edit kept the same_id. Deduplication and identity continuity across server upgrades are unproved. - Real submissions carried
_uuid, and edits changed it. The pack still refuses a submission missing it. - Edited submissions retained
meta/rootUuid. Legacy submissions and every historical form version were not tested. The maintained asset-scoped key remains_id. - A source edit stayed behind the saved keyset tail.
A rescan found it; an ordinary tail read did not.
Keep
edits: rescanand the bounded reconciliation interval. Deletion history is not a poll-only change feed. - A fixed
limit=100returned pages of 100 and 1, followed by an empty tail. A 30,000-item deployment and bulk-cap behaviour were not exercised. Size the response bound and the rescan cost for each form (see Wide forms). sort={"_id":1}and the$gtkeyset filter returned exactly the expected ascending continuation. This was not a concurrent-writer or server-upgrade test.- Group answers used slash-separated names, including a numeric answer encoded as a string. Group and repeat nesting and ambiguous-name refusal have synthetic replay coverage; not every repeat or legacy form shape was exercised against a server.
- The
Tokenauthentication the pack declares has synthetic replay coverage only.
A direct registration job does not establish the separate Coordinator workflow, automatic corrections, or approval authority for the ingestion service. A service-initiated Proposal also needs a review policy compatible with that actor: a policy requiring a human initiator refused a separate fixture before task creation. Do not relax a production review policy to copy a synthetic run.
Wide forms
Section titled “Wide forms”The pack fixes the page at limit=100 and the endpoint at 1 MiB (maximumResponseBytes: 1048576).
A form whose submissions average more than about 10 KB (many questions, repeat groups, attachments,
geolocation) makes a full page exceed that bound.
The send then fails with the same page on every pass, and the position never moves.
Neither the runtime nor the job can change the pack’s page size, and the runtime may only lower the
response bound.
The fix is a pack of your own for that form, pinned in place of the maintained one:
- Copy
pack.yamland itsscripts/directory to a directory you own. Give the copy a newid(orversion) so nobody mistakes it for the maintained pack. - In the copy, lower
limit(for example to"25"), or raise the endpoint’smaximumResponseBytes(the ceiling is 16 MiB, 16777216), or both. A lowerlimitalso lowers the rescan cost per page. - If you raised
maximumResponseBytes, raiseprofile.maximumResponseBytesandprofile.maximumPageBytesin the job to match. The profile is never tighter than the endpoint. If you loweredlimitalone, nothing else needs to change. - Recompute the pack digest with
shasum -a 256 pack.yaml. Put it insource.pack.digestof your job file and inpack.digestofproject.yaml. Updateidorversionin both places if you changed them. - Run
adapterctl job checkwith your pack. The check refuses a stale digest and names the field.
The maintained pack and its digest stay unchanged, so you can still compare your copy with it.
Fixtures
Section titled “Fixtures”The pack carries five synthetic fixture suites, with documented provenance and an unverified
upstream version:
- A first run reading the first 100 of 130 submissions.
- The continuation, reading the remaining 30 and holding the tail.
- A later pass picking up two new submissions.
- The empty pages (at the tail and on a first run).
- A 401 suite expecting the
credential.rejectedclass.
Every name and value in them is made up. The maintained facade fixture shape has a profile operation per entry, which a job route does not have, so these files keep the stable envelope and carry a provisional job entry shape, marked in each header. The repository’s replay test compiles the pack’s route through the job compiler and replays every fixture entry. It checks the exact request the route sends (path and query) and the item page or problem class that comes back. The same test holds the refusal cases: a reply reaching back past the cursor, and a name that is both an answer and a group.
ODK Central pack
Section titled “ODK Central pack”No ODK Central server has been reached with this pack.
Every upstream shape is synthesised from the published documentation, every fixture is synthetic with
documented provenance, and testedVersions is empty.
The Central documentation names feature versions ($orderby since v2024.1, which this pack needs) but
pins no server version the pack was run against.
Treat the pack as unproved until a controlled deployment answers the questions in
Behaviour to confirm.
What the routes read
Section titled “What the routes read”Two source routes share one odk-odata HTTP endpoint.
Both pin the read order rather than leave it to Central’s default (newest first), both use $top=100,
and neither follows the reply’s @odata.nextLink: Central’s $skiptoken pages in its default
newest-first order, so it cannot resume an ascending scan.
Neither route uses $expand or $select.
odk-submissionsreads the Submissions entity set of one form’s OData service,GET /v1/projects/{projectId}/forms/{xmlFormId}.svc/Submissions, one page per run. Every send carries$orderby=__system/submissionDate asc; past the first run it also carries$filter=__system/submissionDate ge <cursor date>. Both__system/submissionDatefiltering and$orderbyare documented for the Submissions entity set.odk-repeatsreads one repeat entity set. Central exposes each repeat as its own entity set (for exampleSubmissions.household.member), so the deployment binds the endpoint base path to that set. Every send carries$orderby=$root/Submissions/__system/submissionDate asc(repeat rows in their parent submission’s order, with the$root/prefix the documentation gives for repeat filters) and$skipfrom the cursor’s offset.
The odk-submissions cursor is {submissionDate, seen}: the date of the last row read, as Central
rendered it, and every id the reply carried at that date.
The filter’s bound is inclusive (ge), so the next reply starts with the rows at the cursor date
again; those the cursor lists as seen are dropped, and the rest are new.
The inclusive bound with a seen list, instead of a strict gt, covers submissions that share one
rendered millisecond: Central stores the timestamp more finely than it renders it, so a strict filter
on the rendered value could skip a row.
Both routes hold their place at the tail of the ongoing scan:
- A page with rows hands out the position after its last row (
{submissionDate, seen}or{offset}). - An empty page hands the incoming cursor back unchanged, so the next pass reads only what arrived since.
- A first run over a form with nothing to read hands out no cursor.
odk-submissions refuses a reply that is out of submission-date order or reaches back before the
cursor date (a server that ignored $orderby or $filter).
It also refuses more than 40 ids at one rendered date: the cursor would outgrow its 2 KiB bound, and a
page of nothing but seen rows would never move on.
Each of these refusals ends the pass with the script error class and leaves the position unchanged,
so the next pass fails the same way until the cause is gone; the pack has no runtime setting that
skips it.
A bulk server-side import can cause the 40-id refusal.
The pack carries the limit, so a deployment that must read past such a date forks the pack (raise the
40 in the pack’s shape-page.rhai script, within the cursor’s 2 KiB bound) and repins its digest in
the job and project files.
The odk-repeats offset is a position in a list that can change.
A deleted repeat row, or a parent submission that arrives late with an older submission date, shifts
the rows after it by one, and the shifted row is skipped until the next rescan (edits: rescan, every
3600 seconds) reads it again.
An added row only reads one row again, which key-deduplicated absorbs.
The project, form, and entity set a job reads are deployment values.
A source route carries no template parameters, so the runtime configuration binds the odk-odata
endpoint’s baseUrl to the entity-set URL of your own form (origin plus base path), and the pack sends
path: /.
A job on the odk-repeats route binds it to the repeat entity set’s URL instead.
The odk-central-job example
shows the binding in job-runtime.example.yaml.
Authentication
Section titled “Authentication”Central accepts Basic auth over HTTPS (its own documentation calls it “allowed, but strongly
discouraged” because every request re-verifies the password) and bearer session tokens minted by
POST /v1/sessions, which expire by default after 24 hours.
An endpoint declares one kind, so the pack declares basic.
The session-token alternative needs a credential kind that owns the session exchange: mint once, carry
Authorization: Bearer, and mint again on expiry.
A static-authorization pin carries one static value, and a 24-hour session token is not static.
So Basic over mandatory TLS is what the pack supports, and the session-token credential is an engine
capability to ask for, not a pack edit.
Central answers 401 without a WWW-Authenticate challenge.
The engine’s authentication plan raises the uncatchable credential.rejected before any route step sees
it.
Item mapping
Section titled “Item mapping”keyis the entity’s__id(the documented OData key; Central’s field table maps it to the submissioninstanceId).revisionis__system/updatedAt, or__system/submissionDatewhile the submission was never edited. Central leavesupdatedAtnull when a submission is first created, so the fallback keeps an unedited submission’s revision stable and an edit changes it.valueis the entity object exactly as the page returned it.odk-repeatskeys are the repeat row’s own__id. Central derives it from the parent instance and the row’s place in it, and gives the parent’s instance id under__Submissions-id(__Submissions-<group>-idfor a repeat nested in a group). The route requires one such member, so a binding to the Submissions set fails instead of passing submissions off as repeat rows, andvaluecarries it unchanged. A repeat row carries no__system, so its item carries no revision.
A page whose entities lack the mapped members fails rather than producing weaker items.
The key and revision mappings rest on documentation, not on a probe.
Behaviour to confirm
Section titled “Behaviour to confirm”Confirm each of these against a controlled deployment before you rely on the pack:
__idis the submission instance UUID, unique and stable, on your Central version.__system/updatedAtchanges on every edit on your Central version.- Your Central honours both
$orderbyand agefilter on__system/submissionDate. Check how many submissions share one rendered millisecond at your submission rate (the pack refuses more than 40), and that a submission’ssubmissionDatestays fixed across edits. - Central accepts the
$root/Submissions/__system/submissionDateordering on a repeat set, the order is stable for rows of one parent, and the__idand__Submissions-idmembers read as described. New submissions append at the end, but an edit that adds or removes a repeat row in an older submission shifts every later row by one: an added row reads one row again, and a removed row skips one until the periodic rescan. - The session-token credential: what a session-owning credential kind needs, and whether Central’s default 24-hour expiry fits your job cadence.
Fixtures
Section titled “Fixtures”The pack carries six synthetic fixture suites, with documented provenance and an unverified upstream
version:
- A first run reading the first 100 of 130 submissions (two of them edited, the rest with a null
updatedAt). - The continuation, which drops a boundary submission sharing its millisecond with the next one and holds the tail.
- A later pass picking up two new submissions.
- The empty pages (at the tail and on a first run).
- A 401 suite expecting the
credential.rejectedclass. - One repeat-table suite.
Every name and value in them is made up. The repository’s replay test compiles the pack’s routes through the job compiler and replays every fixture entry, and it holds the refusal cases: a reply reaching back before the cursor date, and a repeat route bound to the Submissions set.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.