Skip to content

Parse URL

Parse URLs to extract their components and validate them. The action breaks down URLs into their constituent parts (protocol, hostname, path, query parameters, etc.) and checks whether the hostname resolves via DNS—all in a single step.

The Parse URL action takes a URL string and extracts all its components using the native URL parser. It also performs DNS resolution to verify the hostname actually exists. Use it to analyze URLs, extract tracking parameters, validate links, or route workflows based on URL properties.

The URL to parse. Must include the protocol (http:// or https://).

Example:

https://example.com:8080/path/to/page?utm_source=google&utm_medium=cpc#section
FieldTypeDescriptionExample
protocolStringThe protocol (http, https, etc.)https
hostnameStringDomain without portexample.com
hostStringDomain with port (if present)example.com:8080
portStringPort number (empty if default)8080
pathnameStringThe path portion/path/to/page
searchStringQuery string with ??utm_source=google
hashStringFragment/anchor with ##section
originStringProtocol + hosthttps://example.com:8080
queryParamsJsonStringAll query params as JSON{"utm_source":"google"}

All boolean fields return "TRUE" or "FALSE" as strings.

FieldDescription
isValidUrlWhether the URL parses successfully
hasPathHas a non-trivial path (not just /)
hasQueryParamsHas query parameters
hasHashHas a fragment/anchor
hasPortHas an explicit port number
isSecureProtocol is https:
hostnameResolvesHostname resolves via DNS

Example 1: Validate URLs Before Processing

Section titled “Example 1: Validate URLs Before Processing”

Scenario: Only process contacts with valid, resolvable URLs.

Workflow Setup:

  1. Add Parse URL action with the contact’s website property
  2. Add If/Then branch: isValidUrl equals "TRUE" AND hostnameResolves equals "TRUE"
  3. Continue workflow for valid URLs only

Scenario: Save UTM tracking parameters from URLs to contact properties.

Workflow Setup:

  1. Parse the URL from a form submission or landing page
  2. Use the queryParamsJson output with Parse JSON to extract specific parameters:
    • utm_source → Contact property “Original Source”
    • utm_medium → Contact property “Original Medium”
    • utm_campaign → Contact property “Original Campaign”

Scenario: Flag contacts with insecure website URLs.

Workflow Setup:

  1. Parse the contact’s website URL
  2. If isSecure equals "FALSE":
    • Set contact property “Website Security” to “HTTP Only”
    • Create task to review security

Scenario: Route leads differently based on their company website domain.

Workflow Setup:

  1. Parse the company website URL
  2. Use hostname in If/Then branches:
    • If hostname contains .edu → Route to Education team
    • If hostname contains .gov → Route to Government team
    • Otherwise → Route to General Sales

Scenario: Ensure submitted links are valid before creating content.

Workflow Setup:

  1. Parse the submitted URL
  2. Check multiple conditions:
    • If isValidUrl equals "FALSE" → Reject: “Invalid URL format”
    • If hostnameResolves equals "FALSE" → Reject: “Domain doesn’t exist”
    • If hasPath equals "FALSE" → Warn: “URL points to homepage only”
  3. Otherwise → Accept and continue

The action parses any URL with a valid protocol:

  • https://example.com — Simple domain
  • http://example.com:8080/path — With port and path
  • https://sub.domain.example.com — Subdomains
  • https://example.com?key=value&other=123 — With query params
  • https://example.com/path#section — With hash/fragment

If the URL cannot be parsed (missing protocol, invalid format), all component fields return empty strings and all boolean checks return "FALSE".

Invalid InputResult
example.comInvalid (missing protocol)
not-a-urlInvalid
://missing-protocol.comInvalid

The queryParamsJson field contains all query parameters as a JSON object:

URL: https://example.com?foo=bar&baz=qux&empty=

queryParamsJson: {"foo":"bar","baz":"qux","empty":""}

To extract individual parameters, chain the Parse JSON action using the queryParamsJson output.

The hostnameResolves check performs a DNS lookup with a 5-second timeout to verify the hostname has valid DNS records.

What it checks:

  • Domain exists in DNS
  • Has A or AAAA records

What it doesn’t check:

  • Whether the URL returns a successful HTTP response
  • Whether specific paths exist
  • SSL certificate validity

Note: A passing DNS check confirms the domain exists but doesn’t guarantee the specific URL path is accessible.

  • Always check isValidUrl first — Other fields may be empty if URL is invalid
  • Combine with Parse JSON — Extract specific query parameters from queryParamsJson
  • Handle missing protocols — Consider prepending https:// if users commonly omit it
  • Use hostnameResolves for link validation — Catches domains that don’t exist
  • Branch on isSecure — Enforce HTTPS requirements in your workflows
  • Check if company website is valid and resolves
  • Deduct quality points if isValidUrl or hostnameResolves equals "FALSE"
  • Flag .edu or .gov domains for special routing
  • Extract UTM parameters from submitted URLs
  • Parse referral URLs to identify traffic sources
  • Track campaign performance with query parameter analysis
  • Validate URLs in form submissions
  • Check that provided links actually work
  • Ensure URLs use HTTPS for security compliance
  • Extract competitor domains from submitted comparisons
  • Parse competitor URLs for product analysis
  • Route based on industry (by domain pattern)
  • URL parsing: < 1ms (native browser/Node.js URL API)
  • DNS check: 10-5000ms (network dependent, 5-second timeout)
  • Total execution time: Typically 10-500ms

The DNS lookup has a 5-second timeout. If the lookup times out, hostnameResolves returns "FALSE".

  • Parse JSON — Extract specific query parameters from queryParamsJson
  • Match Regex — Custom pattern matching for URLs
  • Validate Email — Similar validation for email addresses