AWS Glue data integration
AWS Glue data integration provides an emulated control plane for catalog metadata and data-integration automation. It lets clients define data resources, start or inspect work, connect completed work to triggers and workflows, and use Glue catalog state to plan downstream data reads. Eligible Glue Spark batch jobs can also run their S3 scripts in a Docker-backed Glue environment. The service also exposes schema registry state and Glue's Iceberg REST catalog for the default Glue catalog and S3 Tables catalogs.
Service boundary
API request flow
The Glue API accepts an action and a JSON request, maps it to catalog, schema registry, run, trigger, workflow, or Iceberg services, and returns an AWS-shaped response. Run-related requests settle simulated elapsed work before conditional triggers evaluate new completions. Container-backed job runs report completion from their script outcome, which then enters the same trigger flow. Request routing and protocols describes the wider request boundary.
The main responsibilities are:
- Keep Glue resource definitions available for later reads and updates.
- Start and report job, crawler, and workflow runs.
- Connect completed work to conditional triggers.
- Keep workflow views and run history consistent with resource state.
- Expose catalog and schema metadata to data readers and Iceberg clients.
References: src/…/GlueJsonHandler.java• L37-78 src/…/GlueJsonHandler.java• L81-115 src/…/GlueJsonHandler.java• L270-289 src/…/GlueIcebergController.java• L19-33
Catalog control plane
Catalog metadata
The catalog control plane manages metadata that describes data rather than processing the data itself. Databases contain tables. Tables can contain partitions, versions, statistics, indexes, and functions. The service also supports related Glue definitions such as connections, classifiers, security settings, data quality rulesets, resource policy, and schema registry resources.
Catalog operations create, read, update, search, list, and delete these definitions. The default catalog stores Glue databases and tables. Created catalogs can also describe federated S3 Tables catalogs. A federated catalog exposes table buckets as child catalogs, namespaces as databases, and S3 Tables as Glue-shaped tables.
Parent and child lifecycle operations preserve resource relationships. Deleting a database removes its tables and database-owned functions. Deleting a table removes its versions, partitions, statistics, and indexes. Table versions preserve archived metadata when a table update does not skip archiving.
References: src/…/GlueCatalogService.java• L40-47 src/…/GlueCatalogService.java• L88-179 src/…/GlueCatalogService.java• L205-244 src/…/GlueService.java• L384-479 src/…/GlueService.java• L696-828
Schema registry
The schema registry keeps named schemas and their versions alongside the data catalog. A registry groups schemas. A schema declares a data format and compatibility mode. Creating a schema creates its first version, while later registrations add versions only when the definition is valid and compatible with the selected mode.
Schema state includes the latest version and an optional checkpoint. Clients can find versions by number, identifier, or definition. They can also compare versions, attach metadata to a version, and tag registries or schemas. A table can refer to a schema version, allowing Glue reads to resolve the version into the table's declared columns.
The default registry is created when a request first addresses it in a Region. Registry and schema identifiers are Regional, and an ARN from another Region does not resolve to local state. Deleting a registry or schema removes its versions and version metadata with it.
References: src/…/GlueSchemaRegistryService.java• L117-171 src/…/GlueSchemaRegistryService.java• L176-232 src/…/GlueSchemaRegistryService.java• L251-345 src/…/GlueSchemaRegistryService.java• L405-605 src/…/Registry.java• L13-45 src/…/Schema.java• L13-57
Catalog-backed table reads
Catalog table metadata guides downstream reads of table data. A read plan uses the table location and declared schema to select a file reader and keep the visible columns aligned with the catalog. Exact-object plans keep a read limited to objects already selected and authorized by the caller. The Storage backend page describes the storage model used by these services.
The plan honors table, storage, and SerDe settings for delimited files. Registered partitions use each partition's own location and values. Iceberg tables use their current metadata location so reads follow the active snapshot rather than every file under the table root.
Partition projection describes partition paths without storing every partition. The reader expands either the configured location template or the default column=value layout. Injected partition keys require a static equality or IN filter for each source alias in the query. A query that does not provide those values is rejected instead of reading an unrestricted path.
References: src/…/GlueTableResolver.java• L64-109 src/…/GlueTableResolver.java• L242-319 src/…/GlueTableResolver.java• L322-390 src/…/GlueTableResolver.java• L618-680 src/…/PartitionProjection.java• L61-123 src/…/PartitionProjection.java• L140-243 src/…/PartitionProjection.java• L303-356
Iceberg REST catalog
The Iceberg REST catalog gives Iceberg clients a standard namespace, table, metadata, and commit interface. The default catalog maps namespaces to Glue databases and Iceberg tables to Glue tables. An S3 Tables catalog maps namespaces and tables to an S3 Tables table bucket.
An Iceberg commit checks the client's requirements against the current metadata, applies the requested updates, writes a new metadata file to S3, and moves the table's current metadata pointer. A changed base produces a commit failure. Glue tables keep their current metadata location and schema in catalog state, while S3 Tables controls the warehouse location and version token for its tables.
The endpoint supports single-level namespaces. It returns Iceberg error responses rather than the AWS JSON error envelope. AWS-signed Glue requests are routed to the endpoint. Internal callers can use a short-lived bearer token that pins the request to one account and Region.
This flow shows how an Iceberg client commit becomes catalog state and metadata in object storage.
flowchart LR
A[Iceberg client] --> B[Glue Iceberg REST endpoint]
B --> C{Catalog target}
C --> D[Default Glue catalog]
C --> E[S3 Tables bucket]
B --> F[Check commit requirements]
F --> G[Write new metadata to S3]
G --> H[Move current metadata pointer]
H --> I[Glue or S3 Tables readers see new snapshot]
References: src/…/GlueIcebergController.java• L42-123 src/…/GlueIcebergCatalog.java• L30-40 src/…/GlueIcebergCatalog.java• L113-169 src/…/GlueIcebergCatalog.java• L186-346 src/…/GlueIcebergStore.java• L17-21 src/…/S3TablesIcebergStore.java• L13-19 src/…/GlueIcebergRouteFilter.java• L17-64 src/…/GlueIcebergTokens.java• L14-55
Run lifecycle
Job runs
The job run service models a job run as a stateful operation. A simulated run starts in RUNNING and can settle to SUCCEEDED, STOPPED, or TIMEOUT. Eligible Spark batch jobs can instead run their S3 script in a Docker-backed Glue environment and settle to SUCCEEDED, FAILED, STOPPED, or TIMEOUT from that execution. Per-run settings override job defaults. Job execution properties control whether another active run can start unless run queuing is enabled.
An eligible job uses the configured Glue image and receives the job's arguments, account, Region, and role context. The runner reads the script from the emulated S3 service and routes the script's S3 and Glue calls back to Floci. The script runs outside the request thread, so its end can complete the run while later API reads expose the new state.
Jobs that do not meet the container-run conditions use the simulated path. If Docker is not available, the service also falls back to that path. Simulated runs use the configured emulator duration and job timeout, and settle when a request starts, stops, or reads them. Container-backed runs use the script result, timeout, or stop request instead.
When run queuing is enabled and the job has no capacity, a container-backed run enters WAITING. A finished or stopped run can promote the oldest waiting run when capacity becomes available.
References: src/…/GlueJobRunService.java• L37-51 src/…/GlueJobRunService.java• L146-235 src/…/GlueJobRunService.java• L383-424 src/…/GlueJobRunService.java• L427-539 src/…/GlueJobRunService.java• L542-586 src/…/GlueScriptRunner.java• L9-34 src/…/GlueScriptRunner.java• L37-71 src/…/DockerGlueScriptRunner.java• L48-52 src/…/DockerGlueScriptRunner.java• L120-236 src/…/DockerGlueScriptRunner.java• L238-270 src/…/DockerGlueScriptRunner.java• L380-461
Crawler runs
The crawler run service models a crawler moving between READY and RUNNING, with the finished result exposed through last-crawl information and metrics. When a crawl settles, a crawl runner supplies its outcome. The default runner reads no data store and changes no catalog tables, while another runner can report created, updated, or deleted tables and an error message. A crawl can finish as SUCCEEDED, FAILED, or CANCELLED.
The configured crawler duration controls how long a crawl remains active. Reads settle elapsed crawls and expose their completion state. A running crawler cannot be updated or deleted. A crawler schedule can change between scheduled states, but schedule control does not start a timer-driven crawl in this emulation.
Each finished crawl adds its outcome to the crawler's last-crawl view and bounded recent history. Workflow-owned crawls also remain attached to the workflow run so its graph and action statistics can show the crawl after it finishes. A runner error is converted into a failed crawl so the crawl does not remain active without a completion.
References: src/…/GlueCrawlerRunService.java• L28-37 src/…/GlueCrawlerRunService.java• L84-143 src/…/GlueCrawlerRunService.java• L153-193 src/…/GlueCrawlerRunService.java• L233-269 src/…/GlueCrawlerRunService.java• L271-323 src/…/GlueCrawlerRunService.java• L336-415 src/…/CrawlOutcome.java• L3-24 src/…/CrawlRunner.java• L3-13
Run completion
Run completion is the shared event model used by conditional triggers. Each finished job run or crawl provides a stable position, finish time, final state, chain origin, and optional workflow run. A trigger remembers the last position it processed for each watched resource, so one completion does not fire the same trigger twice.
Completion state belongs to the run history. Job-run bookkeeping also records whether a run is settled by a script runner or by the simulated clock. Trigger positions and workflow-scoped outcomes belong to coordination state. This separation lets the service retain recent completions while safely evaluating them across later requests.
Crawler completion also carries the crawl outcome's error and table-change counts for last-crawl, metrics, and workflow views. Conditional triggers use the terminal crawl state as their event result.
References: src/…/GlueJobRunService.java• L209-235 src/…/GlueJobRunService.java• L297-322 src/…/GlueJobRunService.java• L542-586 src/…/GlueCrawlerRunService.java• L178-204 src/…/GlueTriggerService.java• L681-733 src/…/JobRunBookkeeping.java• L7-41 src/…/CrawlOutcome.java• L7-24
Trigger automation
Trigger types
Triggers connect Glue resources into an automation flow. An ON_DEMAND trigger starts its actions when a client starts it. A CONDITIONAL trigger starts actions after watched jobs or crawlers finish in states named by its predicate. A SCHEDULED trigger stores schedule state, but this emulation does not run a timer for it.
Conditional triggers use ANY or AND logic. ANY fires for each matching completion. AND waits for the latest matching outcome for every condition in the same workflow run when the trigger belongs to a workflow.
The completion flow is:
flowchart LR
A[Job or crawler run] --> B[Terminal completion]
B --> C[Conditional trigger reads unseen completion]
C --> D{Predicate matches?}
D -- No --> E[Remember position]
D -- Yes --> F[Start job or crawler action]
F --> B
References: src/…/GlueTriggerService.java• L35-47 src/…/GlueTriggerService.java• L132-191 src/…/GlueTriggerService.java• L688-733 src/…/GlueJsonHandler.java• L70-78
Trigger chains
A trigger action can start a job or crawler on behalf of the completion that caused it. The origin travels through descendant runs. This allows the service to count work in one chain and stop loops before they create unlimited runs.
The service evaluates several rounds during one run-related request. A failed action launch releases its chain claim. A workflow records launch failures so its final view explains why dependent work did not start.
References: src/…/GlueTriggerService.java• L68-78 src/…/GlueTriggerService.java• L780-881 src/…/GlueJobRunService.java• L97-103 src/…/GlueCrawlerRunService.java• L88-105
Workflow orchestration
Workflow runs
A workflow groups triggers with the jobs and crawlers that they start or watch. Starting a workflow creates a workflow run, merges workflow defaults with request properties, and fires its non-conditional starting triggers. Conditional triggers then carry work through the graph as actions finish.
Workflow views expose status, completion time, action statistics, run properties, and an optional graph. The graph describes trigger relationships and attaches the job runs or crawler history that belong to the selected workflow run.
References: src/…/GlueTriggerService.java• L213-241 src/…/GlueTriggerService.java• L344-398 src/…/GlueTriggerService.java• L535-633 src/…/GlueJsonHandler.java• L606-681
Workflow completion
An active workflow run becomes COMPLETED after trigger evaluation finds no more work and all jobs and crawls in the run have finished. A stop request stops active actions and marks the workflow run STOPPED. A launch error can mark the run ERROR when requested starting or resumed actions cannot start.
Workflow concurrency limits are checked before a new run starts. Resuming a finished workflow creates a new run and restarts selected job or crawler nodes that ran in the original run. Finished workflow state no longer affects later runs after its coordination records are removed.
References: src/…/GlueTriggerService.java• L244-341 src/…/GlueTriggerService.java• L424-520 src/…/GlueTriggerService.java• L522-533
Resource state
Definition and operational state
Glue resource state has two related parts. Definition state describes what a database, catalog, table, job, crawler, trigger, or workflow is configured to do. Operational state describes active work, recent completion, current metadata, trigger progress, and workflow ownership.
The separation lets a client read a stable definition while its operational view changes. A crawler definition remains the same while its state moves from RUNNING to READY. Its last-crawl result and table-change counts update when the crawl settles. An Iceberg table definition remains addressable while its current metadata location advances after a commit.
References: src/…/GlueService.java• L200-269 src/…/GlueJobRunService.java• L55-70 src/…/GlueCrawlerRunService.java• L53-67 src/…/GlueCrawlerRunService.java• L369-415 src/…/GlueCatalog.java• L12-43 src/…/Table.java• L12-51
Coordination state
Coordination state links completed work to future automation. It records trigger positions and outcomes, chain origins and budgets, workflow ownership, and the job runs or crawls that belong to each workflow run. Job-run bookkeeping also records completion order and whether a script runner owns the run's terminal transition. Catalog state also records table versions and current Iceberg metadata locations.
This state makes repeated reads safe and lets a later request continue an existing automation chain. It also prevents a script-backed run from being settled by the simulated clock. When a workflow or resource is deleted, its owned coordination state is removed or detached so old work does not affect a new resource or workflow run. Iceberg commits use the current table token or version as their coordination point, so concurrent writers receive a conflict instead of overwriting a newer commit.
References: src/…/GlueTriggerService.java• L85-106 src/…/GlueTriggerService.java• L487-533 src/…/GlueJobRunService.java• L77-97 src/…/GlueJobRunService.java• L542-605 src/…/JobRunBookkeeping.java• L7-41 src/…/GlueCrawlerRunService.java• L53-58 src/…/GlueService.java• L696-728 src/…/IcebergCatalogStore.java• L18-67
Stored resource ARNs
Stored resource ARNs provide the tag view that IAM checks when a request names a Glue resource. Glue resolves tags from the resource named by the full ARN and keeps account and Region identity in that lookup. Name-based Glue resources do not need a separate generated identifier for this check.
Registry and schema tags come from schema registry state. Other Glue resource tags come from the shared tagging state. A missing or deleted resource returns no stored tags, so authorization cannot reuse tags from an older resource with the same name.
The IAM and auth page describes how this resource lookup fits into request authorization.
References: src/…/GlueStoredResourceArns.java• L11-37 src/…/GlueService.java• L3231-3283 src/…/GlueSchemaRegistryService.java• L643-667
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the run action set in
GlueJsonHandleraligned with requests that settle runs and fire conditional triggers. - Keep the conditions for container-backed script runs aligned with job command, mode, script location, and language settings.
- Preserve the distinction between simulated and script-backed runs when changing run admission, queue promotion, restart handling, or completion logic.
- Keep script-run outcomes mapped to terminal Glue states and completion positions so triggers see one completion for each run.
- Keep script access, job arguments, account and Region scope, IAM role use, and container endpoint routing aligned across the job service and script runner.
- Preserve crawler runner outcomes, table-change counts, error messages, recent history, and workflow-owned crawl records when changing crawl settlement.
- Preserve completion positions, trigger seen-state, chain origins, and workflow ownership when changing job or crawler history.
- Keep workflow status, action statistics, and graph data consistent when action completion rules change.
- Preserve cleanup across definitions, run records, trigger state, workflow state, table versions, and Iceberg metadata pointers.
- Keep schema registry version indexes aligned with stored schema versions, latest-version fields, checkpoints, and definition lookups.
- Keep table schema references aligned with registry versions and the columns exposed to readers.
- Keep stored resource ARN lookups aligned with account, Region, resource deletion, and tag ownership rules.
- Keep the Iceberg REST catalog route, bearer-token account and Region pinning, and error response format aligned.
- Preserve the distinction between Glue-managed table locations and S3 Tables-managed warehouse locations.
- Keep Glue table schema and metadata-location fields aligned with Iceberg metadata files used by readers.
- Preserve partition projection path rules, registered-partition locations, and injected-column filter checks when changing table properties or query handling.
- Keep federated Glue catalog identifiers aligned with S3 Tables bucket and namespace identity.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A job starts while active runs meet its concurrency limit | The request fails with ConcurrentRunsExceededException | Run admission checks settled active runs and the job limit before storing the run |
| A container-backed job starts while Docker is unavailable | The script does not run; the job uses the simulated run path | Runner availability is checked before the service marks the run as script-backed |
| A script-backed run cannot read its S3 script or start its container | The run becomes FAILED instead of remaining active | The runner checks the script in the run's account and Region and reports start failures to the job service |
| A script exits with a non-zero code | The run becomes FAILED and its completion can drive a conditional trigger | The runner returns the exit code and the job service maps zero to SUCCEEDED and other codes to FAILED |
| A script run reaches its timeout or receives a stop request | The first terminal transition wins; later script or stop results are ignored | The job service checks terminal state before applying the runner outcome |
| A queued script run outlives a reset or restart | The run becomes FAILED rather than starting without a live owner | Waiting and script-running state is tracked in bookkeeping and in-process execution state |
| A crawl runner throws while a crawl settles | The crawl becomes FAILED with an error message and can reach workflow history | Crawl settlement converts runner errors into a terminal CrawlOutcome |
| A crawler is updated or deleted while it is running | The request fails with CrawlerRunningException | Crawler mutations require a settled non-running state |
| A crawler schedule is started without a schedule or while active | The request fails with a schedule-state error | Schedule control checks that a schedule exists and is not already active |
| A conditional trigger has already processed a completion | The expected action does not start again | Per-resource completion positions are stored as trigger state |
| A trigger chain reaches its run budget | Descendant actions stop and the loop does not continue | Each origin has a bounded triggered-run count |
| A workflow action cannot launch | The workflow records an error and may finish as ERROR | Launch failures are attached to the workflow run |
A schema version is incompatible or compatibility is DISABLED | Registration fails and no new version is stored | Definition validation and compatibility checks run before version creation |
| A request deletes the latest schema version while older versions remain or deletes the checkpoint | The version deletion returns an item error | Version deletion protects the latest remaining version and checkpoint |
| A registry or schema ARN names another Region | The resource is treated as not found | ARN resolution requires the request Region to match stored state |
| An Iceberg commit uses an old table version or metadata base | The commit fails with an Iceberg CommitFailedException | The store compares the commit base with the current table token or version |
| An S3 Tables Iceberg create names a location | The request fails because the table location is service-owned | The S3 Tables catalog store creates and returns the warehouse location |
| A projected table omits a required injected partition filter | The query fails with InvalidRequestException | Projection checks each used table alias for a static equality or IN condition |
| A table has no usable storage location | A catalog-backed read plan cannot be created | Table resolution requires a non-blank location |
| A parent catalog resource is deleted while child metadata is being changed | Child state can be lost or remain after the parent is gone | Parent and child lifecycle operations share a synchronized service boundary |
Key files
| File | Why to read it |
|---|---|
| src/…/GlueJsonHandler.java | Shows the public Glue action boundary and how requests reach catalog, schema registry, run, trigger, workflow, and Iceberg-adjacent services. |
| src/…/GlueService.java | Shows the catalog resource model, schema-reference resolution, tagging boundary, and database, table, job, crawler, trigger, and workflow definitions. |
| src/…/GlueCatalogService.java | Shows created catalogs and Glue-shaped views over federated S3 Tables catalogs. |
| src/…/GlueSchemaRegistryService.java | Shows registry, schema, version, compatibility, checkpoint, metadata, and tag behavior. |
| src/…/Registry.java | Shows the public registry state and tag fields. |
| src/…/Schema.java | Shows schema identity, format, compatibility, version markers, status, and tag fields. |
| src/…/GlueJobRunService.java | Shows job run states, simulated and script-backed completion, concurrency, queue promotion, and workflow ownership. |
| src/…/GlueScriptRunner.java | Defines the boundary between stored Glue job state and an execution backend. |
| src/…/DockerGlueScriptRunner.java | Shows how an S3-backed Glue script runs in Docker and how stop, timeout, credentials, logs, and cleanup affect the run. |
| src/…/JobRunBookkeeping.java | Shows the private state that orders completions and links runs to trigger chains, workflows, and script execution. |
| src/…/GlueCrawlerRunService.java | Shows crawler state, lazy completion, runner outcomes, metrics, history, and workflow crawl ownership. |
| src/…/CrawlOutcome.java | Defines the terminal crawl result and the table changes or error exposed by the crawl. |
| src/…/CrawlRunner.java | Defines the boundary between crawler run state and the crawl operation that produces its outcome. |
| src/…/GlueTriggerService.java | Shows trigger firing, chain control, workflow orchestration, and completion rules. |
| src/…/GlueStoredResourceArns.java | Shows the Glue resource-tag lookup used by IAM authorization. |
| src/…/GlueTableResolver.java | Shows how catalog table metadata becomes a downstream read plan for files, registered partitions, and Iceberg snapshots. |
| src/…/PartitionProjection.java | Shows projected partition paths and query constraints for injected columns. |
| src/…/GlueIcebergController.java | Shows the Iceberg REST catalog interface and its supported operations. |
| src/…/GlueIcebergCatalog.java | Shows namespace, table, metadata, commit, and delete behavior across Glue and S3 Tables catalogs. |
| src/…/GlueIcebergStore.java | Shows how the default Iceberg catalog maps to Glue databases and tables. |
| src/…/S3TablesIcebergStore.java | Shows how a federated S3 Tables bucket owns namespaces, locations, and metadata pointers. |
| src/…/IcebergTableMetadata.java | Shows the high-level commit requirements and metadata updates applied by the REST catalog. |