Job Management
This section of the API focuses on managing and executing jobs. Jobs are a way to combine a source, a mapping, and a target format into a reusable workflow for data transformation that is executed every 24 hours.
Job Schema
The JobSchema
type includes the following fields:
id
: Unique identifier for the jobstatus
: Current status of the jobsourceID
: ID of the associated sourcemappingID
: ID of the associated mappingtargetSchemaID
: ID of the associated target formatlastRun
: Timestamp of the last executionsource
: AssociatedSourceSchema
object, this triggers an additional querymapping
: AssociatedMappingSchema
object, this triggers an additional query to fetchtargetFormat
: AssociatedTargetFormatSchema
object, this triggers an additional query to fetchwebhooks
: All associatedWebhookSchema
objects, this triggers an additional query to fetch
Queries
getJobs
Retrieves all saved jobs.
Example:
This query returns an array of all saved jobs, including details about their associated source
, mapping
, and target format
.
Mutations
saveJob
Saves a new job, associating a source, mapping, and target format.
Example:
This mutation creates a new job by combining existing or new components:
source
: The source to use (can be an existing source ID or a new source request).mapping
: The mapping to apply. If no mapping is given, a mapping will be generated based on the source data.targetFormat
: The target format to transform the data into. If no target format is given, the default target format will be used.
After initialization, the job will be run once. After that, it will be automatically run every 24 hours. You can manually trigger a job execution using the runJob
mutation.
The mutation returns the ID of the newly created job.
deleteJob
Deletes a saved job.
Example:
This mutation removes a job from the system. It returns true
if the deletion was successful, false
otherwise.
runJob
Executes a saved job.
Example:
This mutation triggers the manual execution of a saved job. It performs the following steps:
- Fetches data from the associated source
- Applies the specified mapping to the data
- Transforms the result into the target format
It returns true
if the job execution was successful, false
otherwise.