Skip to Content
DocumentationIntroductionKey ConceptsActions and Targets

Actions and Targets

Actions and Targets are a system in ChronoFlow that works like a notification system. Actions define things that can happen in ChronoFlow, and targets define what should happen in reaction to those actions.

Overview

The Actions and Targets system allows ChronoFlow to automatically respond to events that happen in your organization. When something happens (an action), ChronoFlow can automatically trigger responses (targets) without any manual intervention.

Understanding the System: A Simple Analogy

Think of Actions and Targets like a doorbell system:

  • An Action is like someone ringing the doorbell—it’s something that happens (the doorbell rings)
  • A Target is like what happens when the doorbell rings—maybe the lights turn on, or a notification is sent to your phone

You can set up multiple targets for one action. So when the doorbell rings (action), you might have the lights turn on (target 1), get a notification on your phone (target 2), and have the door unlock (target 3)—all happening automatically.

This is similar to what’s called a “publish/subscribe” (pub/sub) system in technical terms. In simple terms:

  • Publish means “something happened” (the action)
  • Subscribe means “I want to know when that happens and do something” (the target)

When you set up an action with targets, you’re saying: “When this action happens, automatically do all these target things.”

Actions

An action defines a thing that can happen in ChronoFlow. Actions are events that occur in your system that you want to respond to automatically.

Currently Supported Actions

Start Workflow Request

This action is triggered when someone clicks “Start Workflow” on the workflows page. This allows you to automatically trigger workflows when users manually start them.

Task Completed

This action listens for when a specific task is completed, identified by its task ID. When that particular task is completed, the action is triggered and all its associated targets are fired.

Targets

A target defines what should happen in reaction to an action. When an action occurs, all targets assigned to that action are automatically triggered.

Currently Supported Targets

Webhook

A webhook target sends an HTTP request to a specified URL when the action occurs. When creating a webhook target, you define:

  • URL: The web address where the request should be sent
  • HTTP Method: The type of request (GET, POST, PUT, etc.)
  • Headers: Any additional information to include in the request (like authentication tokens or custom data)

Webhooks are a way for ChronoFlow to notify other systems or services when something happens, allowing those systems to respond automatically.

Assigning Actions to Targets

You assign an action to one or more targets. When the action is detected to have happened, it automatically fires all of its assigned targets.

For example:

  • You might have an action called “Task Completed” for a specific task
  • You assign it to three targets: a webhook to notify n8n, a webhook to update a database, and a webhook to send an email
  • When that task is completed, all three webhooks are automatically triggered

Connecting to n8n Workflows

Actions and Targets are the way that n8n workflows are started from ChronoFlow. Here’s how it works:

Step-by-Step Example

  1. Create a workflow in n8n:

    • In your n8n instance, create a new workflow
    • Add a trigger node of type “Webhook” and select “Listen for Webhook”
    • n8n will provide you with a webhook URL (a special link that n8n will listen to)
  2. Copy the webhook URL:

    • Copy the webhook URL that n8n generated for you
    • This is the address where n8n is waiting to receive notifications
  3. Create a target in ChronoFlow:

    • In ChronoFlow, create a new target of type “Webhook”
    • Paste the webhook URL from n8n
    • Set the HTTP method (usually POST)
    • Add any headers if needed (like authentication tokens)
  4. Create an action in ChronoFlow:

    • Create an action called something like “Start my workflow”
    • Designate that its target is the webhook target you just created
  5. Connect the action to the workflows page:

    • When someone goes to the workflows page and clicks “Start Workflow”, the “Start Workflow Request” action is triggered
    • If you’ve assigned your webhook target to this action, the webhook fires
    • n8n receives the webhook and starts your workflow

Complete Example Flow

Here’s the complete flow when someone clicks “Start Workflow”:

  1. User clicks “Start Workflow” on the workflows page
  2. ChronoFlow detects the “Start Workflow Request” action
  3. ChronoFlow fires all targets assigned to that action (including your n8n webhook)
  4. The webhook sends a request to your n8n instance
  5. n8n receives the webhook and starts the workflow
  6. The workflow runs in n8n, potentially creating tasks in ChronoFlow using n8n ChronoFlow nodes

This creates a seamless connection between user actions in ChronoFlow and automated workflows in n8n.

Use Cases

Actions and Targets enable many automation scenarios:

  • Start workflows manually: Users can trigger n8n workflows by clicking a button
  • React to task completion: Automatically start processes when specific tasks are done
  • Integrate with external systems: Send notifications to other services when events occur
  • Chain processes: One action can trigger multiple targets, creating complex automation chains

This system provides the flexibility to connect ChronoFlow events with any system that can receive webhooks, making it a powerful foundation for automation.

Last updated on