Skip to content

Imports and ingestion

Imports and integrations bring outside data into Ryot through plugin workflows. This page covers retry-safe submission inputs, how import sources declare their inputs and plans, how scripts read configuration and integrations, how setup screens decide whether a source is ready, and how runs report progress.

Retry-safe operation inputs spread SubmissionEnvelope.fields from @ryot-app/plugin-kit/schema.

Field Rule
Submission time An IsoTimestamp
Submission ID Nonblank, at most 96 characters
shared/log-operations.ts
import { NonBlankString, SubmissionEnvelope } from "@ryot-app/plugin-kit/schema";
export const LogEntryInput = Schema.Struct({ ...SubmissionEnvelope.fields, note: NonBlankString });

NonBlankString rejects whitespace-only text.

Import sources map strict input schemas to workflows. Each declares a slug, name, description, the workflowSlug it starts, an inputSchema, and optionally exportHelp and a plan.

Input kind How it is declared
Upload Top-level string fields with the upload format. The kernel validates each file and exposes it by field name for readNamedArtifact(key).
Payload only Ordinary fields
  • Input schemas are strict, use static choices only, and allow uploads only as top-level string fields.
  • exportHelp declares a docsUrl, steps, or both. Steps are manifest text.

Build input schemas with @ryot-app/plugin-kit/import-inputs:

Helper Declares
uploadInputSchema The upload field, with plugin-owned label, hint, description and allowed file extensions
timezoneUploadInputSchema The upload field plus a required timezone field with plugin-owned label and hint

Export documentation links stay plugin-owned.

manifest/plugin.ts
import { timezoneUploadInputSchema } from "@ryot-app/plugin-kit/import-inputs";
importSources: [
{
slug: "hevy",
workflowSlug: "import",
exportHelp: { docsUrl: "https://docs.ryot.io/importing/hevy" },
name: catalogMessage("import-source.hevy.name"),
description: catalogMessage("import-source.hevy.description"),
inputSchema: timezoneUploadInputSchema(
{
allowedFileExtensions: ["csv"],
description: "Hevy workout export CSV",
label: catalogMessage("property.hevy-export"),
hint: catalogMessage("property.hevy-export-hint"),
},
{ label: catalogMessage("property.timezone"), hint: catalogMessage("property.timezone-hint") },
),
},
],

An import source (or a yank or sink integration provider) can declare plan.selections.

  • Each selection has a fixed value, or a top-level settings field and finite cases mapping setting values to alternative keys.
  • Selections are validated against compiled dependencies.
  • Plan selection is pure and returns an ingestion operation and selection map. It performs no source requests or writes.

Alternatives are declared with defineExecutableAlternatives; see Executable references.

  • Import writes use immutable captures, stable batch identities and kernel receipts.
  • Save the next cursor only after applying the batch and its required confirmation.
  • Cancellation preserves committed records; ambiguous external deliveries keep their existing retry policy.

See Checkpoint workflows for how steps commit.

getPluginConfig({ required: ["token"], optional: ["threshold"] }) reads only the requested keys from the pinned configuration revision.

  • The compiler derives required and optional keys from the used calls, including calls reached through local helpers. Keys must be literals or finite typed values.
  • Values keep their exact JsonValue shape, so declared defaults such as false and 0 are returned rather than treated as missing.
  • Missing required values fail with missing-required-config in SDK error data. Unavailable optional values are omitted.
  • Unrequested keys are not available to the script.
  • The compiler records key metadata, not generated files for the full configuration schema. Scripts do not author per-script key lists.
  • Configuration is never copied into automation input or history. A stored configuration may be at most 64 KiB; larger saves and restores are rejected.
  • Configuration and executable SDK methods must be called directly; method aliases are unsupported.

The schema itself is described in Configuration schema.

listIntegrations({ provider?, isDisabled?, cursor? }) returns one page of at most 20 of the execution user’s integrations as { items, pageInfo }, the page shape RyotQL rows use.

Reading every page
import { readAllPages } from "@ryot-app/plugin-backend-sdk/core";
const integrations =
yield * readAllPages((cursor) => host.listIntegrations({ ...options, cursor }));
  • An integration’s name, provider and settings may be at most 16 KiB together; larger saves and restores are rejected.
  • Notification subscriptions remain portable user configuration. Triggers, runs, attempts, retry state, logs, idempotency keys and encryption keys are not account-backup data.

Ingestion setup loads importSourcesRecipe({ limit }) and integrationProvidersRecipe({ limit }) from @ryot-app/ryotql-recipes. With the selected catalog item, call evaluateImportSourceReadiness(item, settings) or evaluateIntegrationProviderReadiness(item, settings, integrationId?).

  • The structured readiness contains ready, the selected plan and blockReasons.
  • Installation metadata scopes configuration to the exact system or private plugin.
  • Picker readiness covers unconditional requirements. Selected settings refine branch and account connection requirements, and backend admission rechecks them.
  • Refresh the catalog after OAuth success or configuration changes.
  • Presence does not validate remote credentials.

Integration providers have a lot of push, sink or yank. Sink and yank providers name the script they run and may declare a plan; push providers have no script.

Run reports use @ryot-app/contract/modules/imports/ingestion.

  • Each activity has its own ID, real unit, completed count, optional exact total, last advancement and wait.
  • Batch outcomes count committed records, never transport partitions or provider preparation.
  • Issues keep structured reasons and source/operation attribution without credentials, capture locators, raw bodies or execution pins.
  • Run and issue recipes expose these reports and setup blocking directly.

See imports for capture, expiry, cancellation and recovery lifetimes.