Cropwise
powered by syngenta

Working with Ag Operations 🚜

Overview

The Ag Operations domain provides a comprehensive system for managing agricultural tasks and field operations throughout the farming lifecycle. This domain enables organizations to plan, track, and record agricultural activities across properties, fields, and crop zones, supporting both planned operations (work orders) and completed operations (work records).

Cardinality summary

  • Ag Operation ➜ 1 Organization (org_id)
  • Ag Operation ➜ 0..1 Work Order (planned operation)
  • Ag Operation ➜ 0..* Work Records (completed operations)
  • Ag Operation ➜ 0..* Properties (farm properties)
  • Ag Operation ➜ 0..* Seasons (growing seasons)
  • Ag Operation ➜ 0..* Linked Documents (related plans, groups, schemas)
Ag Operation
β”œβ”€β”€ Organization (1)
β”œβ”€β”€ Properties 0..*
β”œβ”€β”€ Seasons 0..*
β”œβ”€β”€ Work Order 0..1
β”‚   └── Resources (assignees, products, equipments, crop zones, etc.) 0..*
β”œβ”€β”€ Work Records 0..*
β”‚   └── Resources (assignees, products, equipments, crop zones, etc.) 0..*
└── Linked Documents 0..*

Key Concepts

ConceptDescription
Ag OperationAgricultural task entity representing a planned or completed field operation
Operation TypeClassification of agricultural activity (spraying, planting, harvesting, scouting, etc.)
Operation StatusLifecycle state: PLANNED, IN_PROGRESS, COMPLETED, or ARCHIVED
Work OrderPlanned operation with intended dates, resources, and locations
Work RecordCompleted operation record with actual dates, resources used, and outcomes
ResourcesMaterials, products, equipment, and machinery used in operations
Linked DocumentReference to related entities (smart plans, operation groups, schemas)
SourceSystem or application that created the operation

Operation Types

The platform supports the following operation types, each with specific attributes and requirements:

Operation TypeDescriptionKey Features
IRRIGATIONWater application to cropsWater volume, irrigation method, duration
LAND_PREPARATIONSoil preparation before plantingTillage type, equipment used, soil conditions
PLANTINGSeed/seedling planting operationsSeeds, planting method, population, depth
SAMPLINGCollection of crop/soil samplesSample type, quantity, analysis purpose
SCOUTINGField inspection and monitoringPest/disease observations, crop stage, severity
TRAPS_SCOUTINGMonitoring using trapsTrap type, pest counts, locations
SPRAYINGApplication of crop protection productsProducts, application rate, spray type (ground/aerial)
HARVESTINGCrop harvesting operationsYield, harvested area, moisture content
MAINTENANCEField/equipment maintenanceMaintenance type, equipment serviced
CP_TREATMENTCrop protection treatmentTreatment products, application method
TRANSPORTATIONMaterial/product transportationOrigin, destination, weight, distance
SOIL_TESTSoil analysis operationsTest type, sample locations, analysis parameters
DETASSELINGRemoval of tassels (corn)Gender type, rows detasseled
FLOWERINGFlowering stage monitoringFlowering stage, observations
ROGUINGRemoval of undesired plantsRoguing method, gender, plants removed

Operation Status Lifecycle

Ag Operations follow a defined status lifecycle:

PLANNED β†’ IN_PROGRESS β†’ COMPLETED
    ↓                        ↓
    ←------- ARCHIVED -------←
  • PLANNED: Work order created, operation scheduled
  • IN_PROGRESS: Operation started, work in progress
  • COMPLETED: Operation finished, work records recorded
  • ARCHIVED: Operation archived for historical purposes

API Documentation

For complete API reference including request/response schemas, authentication, and interactive testing, visit:

πŸ“š Ag Operations API Documentation - Interactive API documentation with request/response examples

Available Endpoints

Basic Operations

MethodEndpointDescription
POST/v3/operations/ag/Create a new ag operation
GET/v3/operations/ag/{id}Get ag operation by ID
PUT/v3/operations/ag/{id}Update ag operation
DELETE/v3/operations/ag/{id}Soft delete ag operation

Batch Operations

MethodEndpointDescription
POST/v3/operations/ag/batch-readGet multiple ag operations by IDs
POST/v3/operations/ag/batch-createCreate multiple ag operations
POST/v3/operations/ag/batch-deleteDelete multiple ag operations
PUT/v3/operations/ag/{id}/recordsAdd work records to existing operation
DELETE/v3/operations/ag/{id}/record/{work_record_id}Delete work record from ag operation

Search & Query

MethodEndpointDescription
POST/v3/operations/ag/filteredAdvanced search ag operations with filters
POST/v3/operations/ag/latestGet latest agrop operations filtered by specified criteria

Business Rules

Work Order and Work Records Requirements

  • An ag operation must have at least a work order OR one work record
  • Operations cannot exist with both work order and work records empty
  • Work records must share the same operation type as the parent ag operation

Status Validation

  • When adding work records to an operation, status must be IN_PROGRESS or COMPLETED
  • Status transitions must follow the lifecycle: PLANNED β†’ IN_PROGRESS β†’ COMPLETED β†’ ARCHIVED

Operation Type Constraints

  • Operation type is immutable after creation
  • Organization ID (org_id) is immutable after creation
  • Each operation type has specific required and optional fields

Error Codes

CodeMessageHTTP StatusWhen Triggered
EAGOP002An Agro Operation need to have at least a WorkOrder or one WorkRecord!400 BAD_REQUESTCreating/updating operation without work order or work records
EAGOP003Invalid operation type400 BAD_REQUESTUnsupported or malformed operation type provided
EAGOP004Agro Operation status should be IN_PROGRESS or COMPLETED400 BAD_REQUESTAdding work records to operation with invalid status
EAGOP005Agro Operation ({id}) already exists on the database!400 BAD_REQUESTAttempting to create operation with duplicate ID
EAGOP006Work Records must share the same type as the Agro Operation!400 BAD_REQUESTWork record operation type doesn't match parent operation
EAGOP007Agro Operation(s) ({ids}) was/were not found!404 NOT_FOUNDRequested operation ID(s) not found during GET, UPDATE, or DELETE

Typical Workflows

Planning and Execution Workflow

  1. Create Planned Operation - Create ag operation with work order containing scheduled dates, crop zones, and planned resources
  2. Start Execution - Update status to IN_PROGRESS when field work begins
  3. Add Work Records - Record actual work performed with start/end times, actual resources used, and outcomes
  4. Complete Operation - Update status to COMPLETED when all work is finished
  5. Review and Archive - Optionally archive completed operations for historical reference

Search and Filtering Workflow

  1. Define Search Criteria - Specify filters (date range, operation type, status, properties, etc.)
  2. Execute Search - Use search or find endpoint with pagination parameters
  3. Process Results - Handle paginated results, iterate through pages as needed

Next Steps

  • Use the Products catalog to register products that will be associated with ag operations (fertilizers, pesticides, and other agricultural inputs used in work orders and work records)