LinkedIn via Pipedream — Post, Comment & Engage
Full LinkedIn automation using Pipedream's OAuth infrastructure. Post as yourself or your organization, comment on posts, search companies, and more.
Prerequisites
- 1. pdauth CLI installed and configured — see pdauth skill
- LinkedIn account connected via OAuth
Quick Start
CODEBLOCK0
OAuth Flow
CODEBLOCK1
User ID convention: Use telegram:<user_id> format for Telegram users.
Available Tools (19 total)
✅ Working via MCP (pdauth call)
| Tool | Purpose |
|---|
| INLINECODE1 | Post as personal account |
| INLINECODE2 |
Post with image (personal) |
|
linkedin-create-comment | Comment on any post |
|
linkedin-create-like-on-share | Like a post |
|
linkedin-search-organization | Search for companies |
|
linkedin-get-current-member-profile | Get your own profile |
|
linkedin-get-member-profile | Get any member's profile |
|
linkedin-get-org-member-access | Check org admin status |
|
linkedin-retrieve-comments-shares | Get comments on a post |
|
linkedin-delete-post | Delete your post |
⚠️ Broken via MCP (requires workaround)
| Tool | Issue | Workaround |
|---|
| INLINECODE11 | "tool name too long" bug | Use direct SDK call |
| INLINECODE12 |
Same bug | Use direct SDK call |
Tool Reference
1. Create Personal Post
CODEBLOCK2
Tips:
- - Keep posts under 3000 characters
- Emojis increase engagement
- Use line breaks for readability
2. Create Image Post (Personal)
CODEBLOCK3
3. Comment on a Post
CODEBLOCK4
Finding post URNs:
- - From LinkedIn URL:
linkedin.com/posts/username_activity-7293123456789012480 → URN is INLINECODE14 - Or use
linkedin-retrieve-comments-shares on known posts
4. Like a Post
CODEBLOCK5
5. Search Organizations
CODEBLOCK6
6. Get Your Profile
CODEBLOCK7
Returns: name, headline, URN, vanity name, etc.
7. Get Member Profile
CODEBLOCK8
8. Check Organization Admin Access
CODEBLOCK9
Returns: ADMINISTRATOR, MEMBER, or INLINECODE18
9. Get Comments on a Post
CODEBLOCK10
10. Delete a Post
CODEBLOCK11
Organization Posting (Workaround Required)
The Bug
INLINECODE19 fails via MCP with:
CODEBLOCK12
This is a Pipedream MCP bug, not a LinkedIn API issue.
Workaround: Direct SDK Call
Create a Node.js script to post as organization:
CODEBLOCK13
Run with:
CODEBLOCK14
Known Organization IDs
| Organization | ID | URN |
|---|
| Versatly | 105382747 | urn:li:organization:105382747 |
Key Reference Values
Pedro's LinkedIn Info
| Item | Value |
|---|
| Member URN | INLINECODE20 |
| User ID (Pipedream) |
telegram:5439689035 |
| Auth Provision ID |
apn_4vhLGx4 |
| Admin of | Versatly (org 105382747) |
URN Formats
| Type | Format | Example |
|---|
| Person | INLINECODE23 | INLINECODE24 |
| Organization |
urn:li:organization:ID |
urn:li:organization:105382747 |
| Post/Share |
urn:li:share:ID |
urn:li:share:7293123456789012480 |
| Comment |
urn:li:comment:(urn:li:share:ID,ID) | Complex nested URN |
Common Patterns
Pattern 1: Post and Verify
CODEBLOCK15
Pattern 2: Engage with Content
CODEBLOCK16
Pattern 3: Research a Company
CODEBLOCK17
Error Handling
Common Errors
| Error | Cause | Solution |
|---|
| INLINECODE30 | No LinkedIn OAuth | Run INLINECODE31 |
| INLINECODE32 |
MCP bug for org tools | Use direct SDK workaround |
|
403 Forbidden | No permission for action | Check org admin status |
|
Invalid URN | Malformed URN format | Use correct format:
urn:li:type:id |
|
Rate limited | Too many API calls | Wait and retry (LinkedIn limits ~100 calls/day) |
Checking Connection Status
CODEBLOCK18
Reconnecting
If OAuth expires or breaks:
pdauth disconnect linkedin --user telegram:5439689035
pdauth connect linkedin --user telegram:5439689035
# Share new link with user
Best Practices
- 1. Rate Limits: LinkedIn is strict. Space out bulk operations.
- Content Quality: LinkedIn penalizes spammy content. Write thoughtfully.
- Org Posting: Always verify admin access before attempting org posts.
- URN Handling: Always validate URN format before API calls.
- Error Recovery: If a post fails, check status before retrying (may have succeeded).
Example Workflow: Complete LinkedIn Campaign
CODEBLOCK20
Files & Configuration
| File | Purpose |
|---|
| INLINECODE37 | Pipedream credentials |
| INLINECODE38 |
pdauth CLI source |
|
~/.openclaw/workspace/skills/pdauth/SKILL.md | pdauth skill reference |
See Also
通过Pipedream实现LinkedIn自动化 — 发布、评论与互动
利用Pipedream的OAuth基础设施实现完整的LinkedIn自动化。可以以个人或组织身份发布内容、评论帖子、搜索公司等。
前置条件
- 1. 已安装并配置pdauth CLI — 参见pdauth技能
- 已通过OAuth连接LinkedIn账号
快速开始
bash
1. 连接LinkedIn(生成供用户点击的OAuth链接)
pdauth connect linkedin --user telegram:5439689035
2. 用户授权后,验证连接状态
pdauth status --user telegram:5439689035
3. 在LinkedIn发布帖子
pdauth call linkedin.linkedin-create-text-post-user \
--user telegram:5439689035 \
--args {instruction: Create a post: Excited to announce our new product launch! 🚀}
OAuth流程
bash
生成OAuth链接
pdauth connect linkedin --user USER_ID
分享给用户:点击授权LinkedIn:<链接>
用户点击 → 通过LinkedIn授权 → 完成
验证连接状态
pdauth status --user USER_ID
用户ID约定: Telegram用户使用telegram:格式。
可用工具(共19个)
✅ 通过MCP正常工作(pdauth call)
| 工具 | 用途 |
|---|
| linkedin-create-text-post-user | 以个人账号发布文字帖子 |
| linkedin-create-image-post-user |
以个人账号发布带图片的帖子 |
| linkedin-create-comment | 评论任意帖子 |
| linkedin-create-like-on-share | 点赞帖子 |
| linkedin-search-organization | 搜索公司 |
| linkedin-get-current-member-profile | 获取自己的个人资料 |
| linkedin-get-member-profile | 获取任意成员的个人资料 |
| linkedin-get-org-member-access | 检查组织管理员状态 |
| linkedin-retrieve-comments-shares | 获取帖子的评论 |
| linkedin-delete-post | 删除自己的帖子 |
⚠️ 通过MCP存在问题(需要变通方案)
| 工具 | 问题 | 变通方案 |
|---|
| linkedin-create-text-post-organization | 工具名称过长错误 | 使用直接SDK调用 |
| linkedin-create-image-post-organization |
相同错误 | 使用直接SDK调用 |
工具参考
1. 创建个人帖子
bash
pdauth call linkedin.linkedin-create-text-post-user \
--user telegram:5439689035 \
--args {instruction: Create a post: Your post content here. Use emojis 🎉 and hashtags #AI #Tech}
提示:
- - 帖子内容控制在3000字符以内
- 使用表情符号可提高互动率
- 使用换行符增强可读性
2. 创建带图片的帖子(个人)
bash
pdauth call linkedin.linkedin-create-image-post-user \
--user telegram:5439689035 \
--args {instruction: Create image post with text: Check out our new office! Image URL: https://example.com/image.jpg}
3. 评论帖子
bash
使用帖子URN进行评论
pdauth call linkedin.linkedin-create-comment \
--user telegram:5439689035 \
--args {instruction: Comment on urn:li:share:7293123456789012480 with text: Great insights! Thanks for sharing.}
查找帖子URN:
- - 从LinkedIn URL获取:linkedin.com/posts/username_activity-7293123456789012480 → URN为urn:li:share:7293123456789012480
- 或在已知帖子上使用linkedin-retrieve-comments-shares
4. 点赞帖子
bash
pdauth call linkedin.linkedin-create-like-on-share \
--user telegram:5439689035 \
--args {instruction: Like the post urn:li:share:7293123456789012480}
5. 搜索组织
bash
pdauth call linkedin.linkedin-search-organization \
--user telegram:5439689035 \
--args {instruction: Search for companies matching: artificial intelligence startups}
6. 获取个人资料
bash
pdauth call linkedin.linkedin-get-current-member-profile \
--user telegram:5439689035 \
--args {instruction: Get my LinkedIn profile}
返回:姓名、头衔、URN、自定义名称等。
7. 获取成员资料
bash
pdauth call linkedin.linkedin-get-member-profile \
--user telegram:5439689035 \
--args {instruction: Get profile for member URN urn:li:person:30_5n7bx7f}
8. 检查组织管理员权限
bash
pdauth call linkedin.linkedin-get-org-member-access \
--user telegram:5439689035 \
--args {instruction: Check my access level for organization 105382747}
返回:ADMINISTRATOR、MEMBER或NONE
9. 获取帖子评论
bash
pdauth call linkedin.linkedin-retrieve-comments-shares \
--user telegram:5439689035 \
--args {instruction: Get comments for post urn:li:share:7293123456789012480}
10. 删除帖子
bash
pdauth call linkedin.linkedin-delete-post \
--user telegram:5439689035 \
--args {instruction: Delete post urn:li:share:7293123456789012480}
组织发帖(需要变通方案)
问题说明
linkedin-create-text-post-organization通过MCP调用会失败,错误信息为:
Error: tool name too long
这是Pipedream MCP的bug,并非LinkedIn API的问题。
变通方案:直接SDK调用
创建Node.js脚本以组织身份发帖:
javascript
// org-post.mjs
import { PipedreamClient } from @pipedream/sdk;
const client = new PipedreamClient({
projectEnvironment: development,
clientId: YOURCLIENTID, // 来自 ~/.config/pdauth/config.json
clientSecret: YOURCLIENTSECRET,
projectId: YOURPROJECTID,
});
async function postAsOrg(orgId, text) {
const result = await client.actions.run({
id: linkedin-create-text-post-organization,
externalUserId: telegram:5439689035,
configuredProps: {
linkedin: { authProvisionId: apn_4vhLGx4 }, // LinkedIn账号ID
organizationId: orgId,
text: text,
},
});
console.log(已发布!, result);
}
// 使用示例
postAsOrg(105382747, Hello from Versatly! 🚀);
运行方式:
bash
node org-post.mjs
已知组织ID
| 组织 | ID | URN |
|---|
| Versatly | 105382747 | urn:li:organization:105382747 |
关键参考值
Pedro的LinkedIn信息
| 项目 | 值 |
|---|
| 成员URN | urn:li:person:30_5n7bx7f |
| 用户ID(Pipedream) |
telegram:5439689035 |
| 认证提供ID | apn_4vhLGx4 |
| 管理员身份 | Versatly(组织ID 105382747) |
URN格式
| 类型 | 格式 | 示例 |
|---|
| 个人 | urn:li:person:ID | urn:li:person:30_5n7bx7f |
| 组织 |
urn:li:organization:ID | urn:li:organization:105382747 |
| 帖子/分享 | urn:li:share:ID | urn:li:share:7293123456789012480 |
| 评论 | urn:li:comment:(urn:li:share:ID,ID) | 复杂的嵌套URN |
常见模式
模式1:发布并验证
bash
发布帖子
pdauth call linkedin.linkedin-create-text-post-user \
--user