Use this when defining the data a job receives.
Inputs · Automation Design
Inputs are the data an automation job receives — parameters, files, inventory, API payloads. Define their names, types and allowed values clearly and validate them before doing anything.
1. Inputs are parameters, inventories, files, API payloads.
2. Validate types, ranges and formats early.
3. Reject unknown fields.
4. Document with examples.
5. Never trust user input.
input → schema validation → automation
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Verification should run before mutation and should include more than one valid example. Validate required/type/range/enum/object-shape rules, then execute semantic checks such as target existence, incompatible option combinations and authorization. Include fixtures for missing fields, unknown fields, empty strings, extreme numeric values, duplicated items and malicious/untrusted text. Show that rejected inputs cause no target-side change. For accepted inputs, record the normalized request (with secrets redacted) and verify downstream components received the same typed meaning. After execution, correlate target read-back with the original request ID so the result can be attributed to the validated input. If a schema validator and runtime implement different defaulting/coercion behavior, treat that mismatch as a defect rather than accepting divergent interpretations.
Step 2 Common mistakes Narrow the fault
- Inputs not validated.
- Too many optional inputs.
Step 3 Where it fails Narrow the fault
The boundaries are decoding, structural schema validation, semantic validation, authorization, target preconditions and execution. A syntactically valid JSON object can still be structurally invalid; a schema-valid request can reference a nonexistent target; an otherwise valid request can be unauthorized; and all of those should fail before mutation. Do not fix input problems by adding broad coercion or silently dropping unknown fields unless the contract explicitly promises that behavior. Show which boundary rejected the request and preserve a request identifier plus safe normalized context. If execution fails after validation, do not report it as 'bad input' without evidence. After changing the contract, replay both accepted and rejected fixtures and verify the mutation boundary remains closed for invalid requests.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Name, type and allowed values for each input.
- Validate before acting.
- Reject unknown inputs.
- Input schema (types, ranges, required) — contract
- Validation at entry — reject bad input
- Examples of valid inputs — documentation
ReferenceWhy it matters1 section · depth on demand
In depth
Inputs are the parameters a caller gives an automation: target hosts, VLAN IDs, versions, ticket numbers. Clear, validated inputs make automation safe to expose to others, because bad values are rejected before anything changes.
| Practice | Example |
|---|---|
| Type and range | VLAN ID integer 2–4094 |
| Allowed values | Environment in {lab, prod} |
| Required vs optional | Defaults documented |
| Format | Hostname regex, IP address parsing |
| Secrets separate | Credentials from a vault, not inputs |
- ansible.builtin.assert:
that:
- vlan_id | int >= 2
- vlan_id | int <= 4094
fail_msg: "vlan_id must be 2-4094"
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Automation inputs are an external contract between a caller and an execution path. A robust design distinguishes transport parsing, structural validation, semantic preconditions, normalization/defaulting and authorization before any side effect. Schema languages such as JSON Schema can constrain types, required properties, ranges, enums and object shape, but business rules may still require cross-field or target-aware validation. Defaults are especially important: documentation defaults, schema annotations and runtime-applied defaults are not necessarily the same thing. Inputs also have provenance—operator form, API request, inventory, environment, event payload or another automation—which affects trust and mutability. Treat secrets and identifiers differently from free-form text, and preserve typed values rather than concatenating them into shell commands. The goal is to turn ambiguous caller data into a validated internal request object.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Version the input contract alongside the automation and define compatibility rules for callers. Adding an optional field is different from changing the meaning/type of an existing field; removals or stricter validation may require a migration window. Keep defaults explicit and test them, because hidden fallback behavior can change production outcomes without any caller-side diff. Separate secret references from secret values and avoid long-lived copies of sensitive inputs in logs. For high-risk automation, split 'what should be done' inputs from approval/authorization context so a caller cannot self-assert permission. Normalize casing, units and identifiers once at the boundary and use the canonical representation downstream. Maintain fixture sets for common, boundary, malformed and legacy requests so schema/runtime changes are regression-tested before deployment.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation Design > Inputs. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://json-schema.org/specification · confidence 94%Quick lookup tables
Automation Design → Inputs · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for Automation Design → Inputs.
| Layer | Automation Design → Inputs operational reference |
|---|---|
| Context identity | JSON Schema 2020-12 / generic automation + exact revision/input/target identity |
| Persistent intent | Versioned contract/configuration with explicit ownership and prerequisites |
| Verification | Validate inputs/read current state → exercise bounded operation → independent target read-back |
| Output contract | Preserve structured status/IDs/properties before human formatting |
| Failure boundary | Separate source/input/engine/controller execution from downstream target outcome |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Input validation output should be machine-actionable: request/field path, validation rule, safe rejected value summary, error code/class and whether processing stopped before side effects. Avoid only returning 'invalid input', which forces callers to guess. For successful validation, expose the normalized non-secret request or a digest/identifier so later stages can show which values they executed. Do not log raw credentials, tokens or secret fields in validation errors. Distinguish syntax/parse errors from schema violations and semantic/target precondition failures because callers can remediate them differently. If multiple fields fail, a structured list is more useful than interleaved logs. This output contract also improves API/UI integration: the same validation model can render human help while remaining deterministic for automated clients.