mirror of
https://github.com/khoaliber/n8nworkflows.xyz.git
synced 2026-04-28 00:29:22 +00:00
creation
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
Check for preview for a link
|
||||
|
||||
https://n8nworkflows.xyz/workflows/check-for-preview-for-a-link--935
|
||||
|
||||
|
||||
# Check for preview for a link
|
||||
|
||||
### 1. Workflow Overview
|
||||
|
||||
This workflow is designed to check whether a preview is available for a specified URL and return that preview if it exists. It leverages the Peekalink API to detect preview availability and conditionally fetches the preview data. The workflow is useful for scenarios where you want to programmatically verify and retrieve link previews before sharing or processing URLs further, such as in chatbots, content management systems, or notification services.
|
||||
|
||||
The workflow is logically divided into the following blocks:
|
||||
|
||||
- **1.1 Input Reception:** A manual trigger node initiates the workflow.
|
||||
- **1.2 Preview Availability Check:** The Peekalink node checks if a preview exists for the given URL.
|
||||
- **1.3 Conditional Branching:** An IF node routes the flow based on preview availability.
|
||||
- **1.4 Preview Retrieval or No Operation:** If a preview is available, the workflow fetches it via another Peekalink node; otherwise, it executes a NoOp node (no operation) to end gracefully.
|
||||
|
||||
---
|
||||
|
||||
### 2. Block-by-Block Analysis
|
||||
|
||||
#### 1.1 Input Reception
|
||||
|
||||
- **Overview:**
|
||||
This block starts the workflow manually. It provides a trigger point to test or run the workflow on demand.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- On clicking 'execute'
|
||||
|
||||
- **Node Details:**
|
||||
- **Node Name:** On clicking 'execute'
|
||||
- **Type:** Manual Trigger
|
||||
- **Role:** Initiates workflow execution manually.
|
||||
- **Configuration:** No parameters set; simply waits for user input to start.
|
||||
- **Inputs:** None (trigger node)
|
||||
- **Outputs:** Connected to the Peekalink node (starts the preview availability check).
|
||||
- **Edge Cases:** No failure expected; manual trigger only.
|
||||
- **Sub-workflow:** None
|
||||
|
||||
#### 1.2 Preview Availability Check
|
||||
|
||||
- **Overview:**
|
||||
This block uses the Peekalink API to verify if a preview exists for the specified URL. It returns a boolean indicating availability.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Peekalink
|
||||
|
||||
- **Node Details:**
|
||||
- **Node Name:** Peekalink
|
||||
- **Type:** Peekalink API integration node
|
||||
- **Role:** Checks if a preview is available for the URL.
|
||||
- **Configuration:**
|
||||
- URL is statically set to `https://n8n1.io` (can be parameterized for dynamic inputs).
|
||||
- Operation set to `isAvailable` to return boolean availability.
|
||||
- Credentials: Uses configured Peekalink API credentials (required).
|
||||
- **Inputs:** Triggered by the Manual Trigger node.
|
||||
- **Outputs:** Boolean `isAvailable` passed to the IF node for conditional branching.
|
||||
- **Edge Cases:**
|
||||
- API authentication failure (invalid or missing credentials).
|
||||
- Network timeouts or API rate limits.
|
||||
- Invalid URL format could lead to false negatives or errors.
|
||||
- **Sub-workflow:** None
|
||||
|
||||
#### 1.3 Conditional Branching
|
||||
|
||||
- **Overview:**
|
||||
This block decides the workflow path based on whether a preview is available or not.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- IF
|
||||
|
||||
- **Node Details:**
|
||||
- **Node Name:** IF
|
||||
- **Type:** Conditional Branching
|
||||
- **Role:** Routes the workflow based on the boolean `isAvailable` output from the Peekalink node.
|
||||
- **Configuration:**
|
||||
- Condition: Check if `{{$json["isAvailable"]}}` is `true`.
|
||||
- True branch: Proceed to fetch the preview.
|
||||
- False branch: Proceed to NoOp node.
|
||||
- **Inputs:** Receives output from Peekalink node.
|
||||
- **Outputs:**
|
||||
- True branch -> Peekalink1 node.
|
||||
- False branch -> NoOp node.
|
||||
- **Edge Cases:**
|
||||
- Expression evaluation fails if `isAvailable` is missing or malformed.
|
||||
- Unexpected data types could cause logic errors.
|
||||
- **Sub-workflow:** None
|
||||
|
||||
#### 1.4 Preview Retrieval or No Operation
|
||||
|
||||
- **Overview:**
|
||||
This block either fetches the preview details or ends the workflow gracefully without action.
|
||||
|
||||
- **Nodes Involved:**
|
||||
- Peekalink1
|
||||
- NoOp
|
||||
|
||||
- **Node Details:**
|
||||
- **Node Name:** Peekalink1
|
||||
- **Type:** Peekalink API integration node
|
||||
- **Role:** Fetches the full preview details of the URL if available.
|
||||
- **Configuration:**
|
||||
- URL dynamically set via expression from the original Peekalink node's parameter (`={{$node["Peekalink"].parameter["url"]}}`).
|
||||
- Uses Peekalink API credentials.
|
||||
- **Inputs:** True branch from IF node.
|
||||
- **Outputs:** Preview data available for further use (e.g., sending to Slack, Mattermost).
|
||||
- **Edge Cases:**
|
||||
- API errors or timeouts when fetching preview.
|
||||
- Missing or changed URL parameter could cause failure.
|
||||
- **Sub-workflow:** None
|
||||
|
||||
- **Node Name:** NoOp
|
||||
- **Type:** No Operation (placeholder)
|
||||
- **Role:** Ends the workflow path when no preview is available, improving visual clarity.
|
||||
- **Configuration:** No parameters.
|
||||
- **Inputs:** False branch from IF node.
|
||||
- **Outputs:** None (ends execution).
|
||||
- **Edge Cases:** None (does nothing).
|
||||
- **Sub-workflow:** None
|
||||
|
||||
---
|
||||
|
||||
### 3. Summary Table
|
||||
|
||||
| Node Name | Node Type | Functional Role | Input Node(s) | Output Node(s) | Sticky Note |
|
||||
|---------------------|-----------------------|------------------------------------|------------------------|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| On clicking 'execute'| Manual Trigger | Starts the workflow manually | — | Peekalink | |
|
||||
| Peekalink | Peekalink API Node | Checks if preview is available | On clicking 'execute' | IF | **Peekalink node:** This node checks if a preview is available for a URL or not. If a preview is available the node returns `true`, otherwise `false`. |
|
||||
| IF | If Condition | Routes flow based on preview check | Peekalink | Peekalink1, NoOp | **IF node:** The IF node checks the output from the previous node. If the condition is `true` the node connected to the ***true*** branch is executed. |
|
||||
| Peekalink1 | Peekalink API Node | Fetches preview details | IF (true branch) | — | **Peekalink1 node:** This node will fetch the preview of the URL. Based on your use-case, you can connect the **Slack node**, **Mattermost node** etc. |
|
||||
| NoOp | No Operation | Ends workflow if no preview exists | IF (false branch) | — | **NoOp node:** Adding this node here is optional, as the absence of this node won't make a difference to the functioning of the workflow. Added for clarity. |
|
||||
|
||||
---
|
||||
|
||||
### 4. Reproducing the Workflow from Scratch
|
||||
|
||||
1. **Create the Manual Trigger node:**
|
||||
- Add a **Manual Trigger** node, name it `On clicking 'execute'`. No parameters need to be set. This node will start the workflow manually.
|
||||
|
||||
2. **Add Peekalink node (Preview Availability Check):**
|
||||
- Add a **Peekalink** node, name it `Peekalink`.
|
||||
- Set **Operation** to `isAvailable`.
|
||||
- Set **URL** parameter to the static URL `https://n8n1.io` (or replace with a parameterized input for dynamic URLs).
|
||||
- Configure **Peekalink API credentials** (create and assign valid API credentials).
|
||||
- Connect output of `On clicking 'execute'` to input of this node.
|
||||
|
||||
3. **Add IF node (Conditional Branching):**
|
||||
- Add an **IF** node, name it `IF`.
|
||||
- Set condition to check if `{{$json["isAvailable"]}}` equals `true` (use boolean condition type).
|
||||
- Connect output of `Peekalink` node to input of `IF` node.
|
||||
|
||||
4. **Add Peekalink node (Preview Retrieval):**
|
||||
- Add a second **Peekalink** node, name it `Peekalink1`.
|
||||
- Set **URL** parameter dynamically with the expression: `{{$node["Peekalink"].parameter["url"]}}` to reuse the original URL.
|
||||
- Configure **Peekalink API credentials** (same as above).
|
||||
- Connect the **true** output of the `IF` node to the input of `Peekalink1`.
|
||||
|
||||
5. **Add NoOp node (No Operation):**
|
||||
- Add a **No Operation** node, name it `NoOp`.
|
||||
- No parameters need to be set.
|
||||
- Connect the **false** output of the `IF` node to the input of `NoOp`.
|
||||
|
||||
6. **Save and execute the workflow:**
|
||||
- Save the workflow.
|
||||
- Trigger it manually to test the behavior.
|
||||
- For dynamic usage, replace static URL inputs with variables or input parameters.
|
||||
|
||||
---
|
||||
|
||||
### 5. General Notes & Resources
|
||||
|
||||
| Note Content | Context or Link |
|
||||
|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
|
||||
| Peekalink API requires valid credentials; ensure you register and generate API keys on the Peekalink platform. | https://peekalink.io/docs |
|
||||
| NoOp node is optional and only added for visual clarity and workflow readability. | n8n Documentation on NoOp Node |
|
||||
| This workflow can be adapted to connect Peekalink1 output to messaging platforms like Slack or Mattermost. | Use Slack or Mattermost nodes after Peekalink1 |
|
||||
| The static URL `https://n8n1.io` is a placeholder; replace with dynamic inputs for production workflows. | Customize URL input for flexibility |
|
||||
Reference in New Issue
Block a user