---
title: "Process Workflow"
canonical: "https://docs.infoblox.com/space/DeploymentGuideIPAMwithServiceNow/1297813171/Process%20Workflow"
format: markdown
---
### IPAM Integration

The script is designed to synchronize IP address management (IPAM) data from Infoblox BloxOne to ServiceNow's Configuration Management Database (CMDB). The synchronization process includes creating and updating objects such as address blocks, subnets, ranges, fixed IPs, IP reservations, DHCP leases in ServiceNow CMDB tables based on changes in the BloxOne IPAM.

### Script Workflow

1. **Initialization**:
  - The script begins by initializing and retrieving essential environment variables, including ServiceNow credentials, API keys, and deduplication flags.
2. **Data Fetching**:
  - **Initial Sync**: The script fetches all IPAM data from Infoblox using the bulk export data API and stores the IP space information in cache. It also retrieves DHCP lease information via the Infoblox DHCP Lease API.
  - **Event-Based Sync**: The script listens for events from audit logs. It monitors changes to IP space objects tagged with the `Snow_sync` tag and performs synchronization for those IP spaces.
3. **Data Filtering and Mapping**:
  - The script filters and synchronizes only the objects within IP spaces that have the `Snow_sync=true` tag.
  - Mapping is performed based on predefined field mappings to ensure correct alignment of Infoblox and ServiceNow data.
    - **Map Data to ServiceNow Tables**:
      - Each record will be mapped to the corresponding ServiceNow table based on its object type:
        - **Address Block**: Mapped to the **cmdb_ci_ip_network** table with fields `ip_address`, `comments`, `name`, `subnet`, and `short_description`.
        - **Address**: Mapped to the **cmdb_ci_ip_address** table with fields `ip_address`, `comments`, `name`, and `short_description`.
        - **Fixed Address**: Mapped to the **cmdb_ci_ip_address** table with fields `ip_address`, `comments`, `name`, `mac_address`, and `short_description`.
        - **Range**: Mapped to the **cmdb_ip_address_range** table with fields `start_ip`, `end_ip`, `u_comments`, `u_name`, and `u_short_description`.
        - **Subnet**: Mapped to the **cmdb_ci_cloud_subnet** table with fields `ip_address`, `comments`, `name`, `cidr`, and `short_description`.
    - **Comments and Tags**:
      - All tags and comments available in Infoblox are added to the `comments` field in the mapped ServiceNow records.
    - **Send Data to ServiceNow**:
      - Once the data is mapped, it will be sent to the corresponding ServiceNow tables for record creation or updates, ensuring accurate synchronization between Infoblox and ServiceNow.
4. **Data Synchronization**:
  - Based on the `servicenowDeduplication` flag, the script either updates existing records or creates new ones in the ServiceNow CMDB.
  - The script supports both create and update operations for the following object types: `address_block`, `address`, `subnet`, `range`, `fixed_address`, and `ddi_dhcp`.
5. **Performing DHCP Initial Sync:**
  1. **Retrieve IP Space and DHCP Lease Data**:
    - Use Infoblox APIs to retrieve all available IP spaces and fetch the tag values from each record.
    - Consider only the IP spaces where the `Snow_sync` tag value is set to "true" and store them in the session.
    - Fetch all DHCP lease records from Infoblox, and for each record, verify if the associated IP space has the `Snow_sync` tag set to "true".
  2. **Ingest Data into ServiceNow**:
    - If the `Snow_sync` tag value is "true" for a particular DHCP lease, ingest the record into ServiceNow.
    - Map the data to the **cmdb_ci_ip_device** table with the following fields: `ip_address`, `mac_address`, `hostname`, and `short_description`
6. **Data Change in Infoblox**:
  - After successful synchronization, the script adds metadata to the synchronized Infoblox objects. It assigns a `Snow_sys_id` tag (the sys_id of the created object in ServiceNow) and the `Snow_cmdb_table_name` tag (the CMDB table where the object was created) using bulk import.

This workflow ensures that data is accurately fetched, filtered, mapped, and synchronized between Infoblox and ServiceNow with proper logging and metadata tagging.