Scheduled runs play a crucial role in automating workflows, ensuring consistent and timely task execution. This guide provides a detailed walkthrough of managing and deleting scheduled runs via API endpoints, allowing you to optimize your operations seamlessly.

As an API user, you can trigger workflows (actions) directly using the POST Launch Workflow API and manage repeat schedules with ease.

Set a Repeat Schedule

To automate your workflows, include the following JSON in the request body when launching a workflow:

https://api.captaindata.co/v3/workflows/:workflow_uid/schedule

Repeat Schedule JSON Structure:

{
  "job_name": "",
  "steps": [...],
  "repeat_option": {
    "type": "minute/hour/day/week/month",
    "value": 5  // Must be an integer representing the interval
  }
}
  • “job_name”: The name of the job you want to launch.
  • “repeat_option”: Specifies the repeat schedule:
    • type: Options include minute, hour, day, week, or month.
    • value: The interval, represented as an integer.

Delete a Repeat Schedule

If you no longer need a repeat schedule, you can delete it using the DELETE Remove Schedule API. Here’s how:

DELETE https://api.captaindata.co/v3/jobs/:job_name

Replace :job_name with the name of the job whose schedule you want to delete.

Which will give the following response:

{
  "message": "Schedule deleted."
}

By setting or removing schedules, you maintain full control over your workflows, ensuring they align with your campaign needs.

Example: Using Repeat Options to Detect Accepted Connection Requests

Objective: Automatically check for accepted LinkedIn connection requests every 3 hours.

Steps

  1. Trigger Workflow: Use the Extract LinkedIn Connections workflow on Captain Data.
  2. Set Repeat Options: Add the following JSON snippet to the workflow’s body:
{
  "steps": [
    {
      "accounts": ["b12579a7-e15d-40ae-910b-..."],
      "parameters": {
        "skip": 0,
        "max_minutes": 180,
        "max_results": 1000
      },
      "step_uid": "6d5c29d2-8c52-4241-8759-..."
    }
  ],
  "unstructure_meta": false,
  "inputs": [], // For this Action you don't need inputs
  "job_name": "Scheduling a Run",
  "repeat_option": {
    "type": "hour",
    "value": 3
  }
}

Result

  • The workflow will extract the most recent connections from the past 3 hours, with a maximum of 1,000 results per run, scheduled to repeat every 3 hours.
  • You can detect and compare new LinkedIn connections with your leads.
  • Once a connection request is accepted, you can enroll leads into the next campaign steps.

Always use a frequency that matches your campaign needs (e.g., every 3 hours is recommended).

Advanced Example: Using the Repeat Option – LinkedIn Campaign Implementation Guide

Checkout this more in-depth Implementation Guide to Build LinkedIn Campaigns for an advanced scheduling example.