outx-mcp-server 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/dist/tools/linkedin.js +99 -0
- package/dist/tools/linkedin.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/linkedin.ts +124 -0
package/README.md
CHANGED
|
@@ -13,7 +13,9 @@ MCP server for the [OutX](https://outx.ai) LinkedIn social listening and data AP
|
|
|
13
13
|
|
|
14
14
|
- **Monitor LinkedIn** — Track posts by keywords, people, or companies with watchlists
|
|
15
15
|
- **Search & filter posts** — 15+ filters: keyword, date, seniority, trending, language
|
|
16
|
-
- **Fetch profiles** — Get full LinkedIn profiles
|
|
16
|
+
- **Fetch profiles & companies** — Get full LinkedIn profiles, company pages, and connections
|
|
17
|
+
- **Search LinkedIn** — Find people by title, company, location, industry, and more
|
|
18
|
+
- **Message connections** — Send direct messages to 1st-degree connections
|
|
17
19
|
- **Engage** — Like and comment on posts through your LinkedIn account
|
|
18
20
|
- **All via natural language** — Just tell your AI agent what you want
|
|
19
21
|
|
|
@@ -107,7 +109,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
|
107
109
|
|
|
108
110
|
> "Create a watchlist to monitor LinkedIn posts about AI startups raising Series A"
|
|
109
111
|
|
|
110
|
-
## Available Tools (
|
|
112
|
+
## Available Tools (28)
|
|
111
113
|
|
|
112
114
|
### Watchlist Management
|
|
113
115
|
|
|
@@ -145,6 +147,11 @@ These tools use the async LinkedIn Data API. The MCP server handles polling auto
|
|
|
145
147
|
|------|-------------|
|
|
146
148
|
| `fetch_linkedin_profile` | Fetch full LinkedIn profile by slug (name, headline, experience, education, skills) |
|
|
147
149
|
| `fetch_linkedin_posts` | Fetch recent posts from profiles by URN |
|
|
150
|
+
| `fetch_linkedin_company` | Fetch company page data by slug (industry, employee count, description, headquarters) |
|
|
151
|
+
| `fetch_linkedin_company_posts` | Fetch recent posts from a company page with engagement data |
|
|
152
|
+
| `linkedin_send_message` | Send a direct message to a 1st-degree connection |
|
|
153
|
+
| `linkedin_search_profiles` | Search LinkedIn profiles by title, company, location, industry, and more |
|
|
154
|
+
| `linkedin_fetch_connections` | Fetch your 1st-degree connections with keyword search and pagination |
|
|
148
155
|
| `linkedin_like_post` | Like a post by activity URN |
|
|
149
156
|
| `linkedin_comment_on_post` | Comment on a post by activity URN |
|
|
150
157
|
| `get_task_status` | Check status of an async task manually |
|
|
@@ -161,13 +168,17 @@ Once connected, try these with your AI agent:
|
|
|
161
168
|
- "What are VPs and Directors posting about machine learning?"
|
|
162
169
|
- "Find posts mentioning our competitor from the last 7 days"
|
|
163
170
|
|
|
164
|
-
**Profile research:**
|
|
171
|
+
**Profile & company research:**
|
|
165
172
|
- "Fetch the LinkedIn profile for williamhgates"
|
|
166
173
|
- "Get recent posts from this prospect's profile"
|
|
174
|
+
- "Get company info and recent posts for OpenAI"
|
|
175
|
+
- "Search for VPs of Engineering at Google in the US"
|
|
176
|
+
- "Show me my most recently added connections"
|
|
167
177
|
|
|
168
|
-
**Engagement:**
|
|
178
|
+
**Engagement & messaging:**
|
|
169
179
|
- "Like the top 3 most engaging posts about product management"
|
|
170
180
|
- "Comment on this post with a thoughtful response"
|
|
181
|
+
- "Send a message to this connection thanking them for connecting"
|
|
171
182
|
|
|
172
183
|
**Workflows:**
|
|
173
184
|
- "Set up a watchlist for 'looking for a CRM' and check it every 6 hours"
|
|
@@ -187,7 +198,7 @@ The OutX API has two surfaces:
|
|
|
187
198
|
|
|
188
199
|
2. **LinkedIn Data API** (async) — Direct LinkedIn proxy. Fetch profiles, get posts, like, comment. All endpoints return a task ID; the MCP server polls automatically until the result is ready.
|
|
189
200
|
|
|
190
|
-
The MCP server wraps both APIs into
|
|
201
|
+
The MCP server wraps both APIs into 28 tools that any MCP-compatible AI agent can call.
|
|
191
202
|
|
|
192
203
|
## Development
|
|
193
204
|
|
package/dist/tools/linkedin.js
CHANGED
|
@@ -45,6 +45,105 @@ export function registerLinkedInTools(server, client) {
|
|
|
45
45
|
const result = await client.pollTask(response.api_agent_task_id);
|
|
46
46
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
47
47
|
});
|
|
48
|
+
server.tool("fetch_linkedin_company", "Fetch a LinkedIn company page by slug. Returns company data including name, industry, employee count, description, headquarters, and logo. Requires the OutX Chrome extension to be active within the last 48 hours. This tool handles async polling automatically.", {
|
|
49
|
+
company_slug: z
|
|
50
|
+
.string()
|
|
51
|
+
.describe("LinkedIn company slug (e.g. 'microsoft' from linkedin.com/company/microsoft)"),
|
|
52
|
+
}, async (params) => {
|
|
53
|
+
const response = (await client.post("/linkedin-agent/fetch-company", {
|
|
54
|
+
company_slug: params.company_slug,
|
|
55
|
+
}));
|
|
56
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
57
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
58
|
+
});
|
|
59
|
+
server.tool("fetch_linkedin_company_posts", "Fetch recent posts from a LinkedIn company page by slug. Returns posts with engagement data (likes, comments, shares). Requires the OutX Chrome extension to be active within the last 48 hours. This tool handles async polling automatically.", {
|
|
60
|
+
company_slug: z
|
|
61
|
+
.string()
|
|
62
|
+
.describe("LinkedIn company slug (e.g. 'openai' from linkedin.com/company/openai)"),
|
|
63
|
+
}, async (params) => {
|
|
64
|
+
const response = (await client.post("/linkedin-agent/fetch-company-posts", {
|
|
65
|
+
company_slug: params.company_slug,
|
|
66
|
+
}));
|
|
67
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
68
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
69
|
+
});
|
|
70
|
+
server.tool("linkedin_send_message", "Send a LinkedIn direct message to a 1st-degree connection. Requires the recipient's person URN (get it from fetch_linkedin_profile or linkedin_search_profiles). Message is sent from your team's oldest admin member's LinkedIn account. Requires the OutX Chrome extension to be active. This tool handles async polling automatically.", {
|
|
71
|
+
recipient_urn: z
|
|
72
|
+
.string()
|
|
73
|
+
.describe("LinkedIn person URN of the recipient (e.g. 'urn:li:person:ACoAABCDEFG')"),
|
|
74
|
+
message: z
|
|
75
|
+
.string()
|
|
76
|
+
.describe("Message text to send (max 10,000 characters)"),
|
|
77
|
+
}, async (params) => {
|
|
78
|
+
const response = (await client.post("/linkedin-agent/send-message", {
|
|
79
|
+
recipient_urn: params.recipient_urn,
|
|
80
|
+
message: params.message,
|
|
81
|
+
}));
|
|
82
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
83
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
84
|
+
});
|
|
85
|
+
server.tool("linkedin_search_profiles", "Search LinkedIn profiles by keywords, title, company, location, industry, and more. Returns matching profiles with name, headline, location, profile slug, and connection degree. At least one filter is required. Requires the OutX Chrome extension to be active. This tool handles async polling automatically.", {
|
|
86
|
+
keywords: z.string().optional().describe("General keyword search across name, headline, and profile text"),
|
|
87
|
+
title: z.string().optional().describe("Filter by job title (e.g. 'VP of Engineering')"),
|
|
88
|
+
company: z.string().optional().describe("Filter by current company name (e.g. 'Google')"),
|
|
89
|
+
first_name: z.string().optional().describe("Filter by first name"),
|
|
90
|
+
last_name: z.string().optional().describe("Filter by last name"),
|
|
91
|
+
geo_urn: z.array(z.string()).optional().describe("LinkedIn geographic URNs (e.g. ['103644278'] for US)"),
|
|
92
|
+
current_company: z.array(z.string()).optional().describe("LinkedIn company URNs for current employer"),
|
|
93
|
+
industry: z.array(z.string()).optional().describe("LinkedIn industry URNs"),
|
|
94
|
+
past_company: z.array(z.string()).optional().describe("LinkedIn company URNs for past employer"),
|
|
95
|
+
school: z.string().optional().describe("Filter by school name (e.g. 'MIT')"),
|
|
96
|
+
profile_language: z.array(z.string()).optional().describe("Language codes (e.g. ['en'])"),
|
|
97
|
+
count: z.number().optional().describe("Number of profiles to return (default 25, max 50)"),
|
|
98
|
+
}, async (params) => {
|
|
99
|
+
const body = {};
|
|
100
|
+
if (params.keywords)
|
|
101
|
+
body.keywords = params.keywords;
|
|
102
|
+
if (params.title)
|
|
103
|
+
body.title = params.title;
|
|
104
|
+
if (params.company)
|
|
105
|
+
body.company = params.company;
|
|
106
|
+
if (params.first_name)
|
|
107
|
+
body.first_name = params.first_name;
|
|
108
|
+
if (params.last_name)
|
|
109
|
+
body.last_name = params.last_name;
|
|
110
|
+
if (params.geo_urn)
|
|
111
|
+
body.geo_urn = params.geo_urn;
|
|
112
|
+
if (params.current_company)
|
|
113
|
+
body.current_company = params.current_company;
|
|
114
|
+
if (params.industry)
|
|
115
|
+
body.industry = params.industry;
|
|
116
|
+
if (params.past_company)
|
|
117
|
+
body.past_company = params.past_company;
|
|
118
|
+
if (params.school)
|
|
119
|
+
body.school = params.school;
|
|
120
|
+
if (params.profile_language)
|
|
121
|
+
body.profile_language = params.profile_language;
|
|
122
|
+
if (params.count)
|
|
123
|
+
body.count = params.count;
|
|
124
|
+
const response = (await client.post("/linkedin-agent/search-profiles", body));
|
|
125
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
126
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
127
|
+
});
|
|
128
|
+
server.tool("linkedin_fetch_connections", "Fetch your 1st-degree LinkedIn connections. Optionally filter by keyword, sort by recently added, and paginate. Connections are from your team's oldest admin member's LinkedIn account. Requires the OutX Chrome extension to be active. This tool handles async polling automatically.", {
|
|
129
|
+
keyword: z.string().optional().describe("Filter connections by name (e.g. 'John')"),
|
|
130
|
+
sort_type: z.string().optional().describe("Sort order. Pass 'RECENTLY_ADDED' for newest first"),
|
|
131
|
+
start: z.number().optional().describe("Pagination offset (default 0)"),
|
|
132
|
+
count: z.number().optional().describe("Number of connections to return (default 40, max 100)"),
|
|
133
|
+
}, async (params) => {
|
|
134
|
+
const body = {};
|
|
135
|
+
if (params.keyword)
|
|
136
|
+
body.keyword = params.keyword;
|
|
137
|
+
if (params.sort_type)
|
|
138
|
+
body.sort_type = params.sort_type;
|
|
139
|
+
if (params.start !== undefined)
|
|
140
|
+
body.start = params.start;
|
|
141
|
+
if (params.count)
|
|
142
|
+
body.count = params.count;
|
|
143
|
+
const response = (await client.post("/linkedin-agent/fetch-connections", body));
|
|
144
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
145
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
146
|
+
});
|
|
48
147
|
server.tool("get_task_status", "Check the status of an async LinkedIn Data API task. Use this to manually check tasks that timed out. Status values: pending, processing, completed, failed.", {
|
|
49
148
|
task_id: z.string().describe("The api_agent_task_id to check"),
|
|
50
149
|
}, async (params) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkedin.js","sourceRoot":"","sources":["../../src/tools/linkedin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,MAAkB;IAElB,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,mPAAmP,EACnP;QACE,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,CAAC,iFAAiF,CAAC;KAC/F,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE;YACnE,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC,CAAkC,CAAC;QAErC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACjE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACzF,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,4MAA4M,EAC5M;QACE,Y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CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAC/D,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iCAAiC,EAAE;YACjE,iBAAiB,EAAE,MAAM,CAAC,OAAO;SAClC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACzF,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/tools/linkedin.ts
CHANGED
|
@@ -82,6 +82,130 @@ export function registerLinkedInTools(
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
+
server.tool(
|
|
86
|
+
"fetch_linkedin_company",
|
|
87
|
+
"Fetch a LinkedIn company page by slug. Returns company data including name, industry, employee count, description, headquarters, and logo. Requires the OutX Chrome extension to be active within the last 48 hours. This tool handles async polling automatically.",
|
|
88
|
+
{
|
|
89
|
+
company_slug: z
|
|
90
|
+
.string()
|
|
91
|
+
.describe("LinkedIn company slug (e.g. 'microsoft' from linkedin.com/company/microsoft)"),
|
|
92
|
+
},
|
|
93
|
+
async (params) => {
|
|
94
|
+
const response = (await client.post("/linkedin-agent/fetch-company", {
|
|
95
|
+
company_slug: params.company_slug,
|
|
96
|
+
})) as { api_agent_task_id: string };
|
|
97
|
+
|
|
98
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
99
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
server.tool(
|
|
104
|
+
"fetch_linkedin_company_posts",
|
|
105
|
+
"Fetch recent posts from a LinkedIn company page by slug. Returns posts with engagement data (likes, comments, shares). Requires the OutX Chrome extension to be active within the last 48 hours. This tool handles async polling automatically.",
|
|
106
|
+
{
|
|
107
|
+
company_slug: z
|
|
108
|
+
.string()
|
|
109
|
+
.describe("LinkedIn company slug (e.g. 'openai' from linkedin.com/company/openai)"),
|
|
110
|
+
},
|
|
111
|
+
async (params) => {
|
|
112
|
+
const response = (await client.post("/linkedin-agent/fetch-company-posts", {
|
|
113
|
+
company_slug: params.company_slug,
|
|
114
|
+
})) as { api_agent_task_id: string };
|
|
115
|
+
|
|
116
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
117
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
server.tool(
|
|
122
|
+
"linkedin_send_message",
|
|
123
|
+
"Send a LinkedIn direct message to a 1st-degree connection. Requires the recipient's person URN (get it from fetch_linkedin_profile or linkedin_search_profiles). Message is sent from your team's oldest admin member's LinkedIn account. Requires the OutX Chrome extension to be active. This tool handles async polling automatically.",
|
|
124
|
+
{
|
|
125
|
+
recipient_urn: z
|
|
126
|
+
.string()
|
|
127
|
+
.describe("LinkedIn person URN of the recipient (e.g. 'urn:li:person:ACoAABCDEFG')"),
|
|
128
|
+
message: z
|
|
129
|
+
.string()
|
|
130
|
+
.describe("Message text to send (max 10,000 characters)"),
|
|
131
|
+
},
|
|
132
|
+
async (params) => {
|
|
133
|
+
const response = (await client.post("/linkedin-agent/send-message", {
|
|
134
|
+
recipient_urn: params.recipient_urn,
|
|
135
|
+
message: params.message,
|
|
136
|
+
})) as { api_agent_task_id: string };
|
|
137
|
+
|
|
138
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
139
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
server.tool(
|
|
144
|
+
"linkedin_search_profiles",
|
|
145
|
+
"Search LinkedIn profiles by keywords, title, company, location, industry, and more. Returns matching profiles with name, headline, location, profile slug, and connection degree. At least one filter is required. Requires the OutX Chrome extension to be active. This tool handles async polling automatically.",
|
|
146
|
+
{
|
|
147
|
+
keywords: z.string().optional().describe("General keyword search across name, headline, and profile text"),
|
|
148
|
+
title: z.string().optional().describe("Filter by job title (e.g. 'VP of Engineering')"),
|
|
149
|
+
company: z.string().optional().describe("Filter by current company name (e.g. 'Google')"),
|
|
150
|
+
first_name: z.string().optional().describe("Filter by first name"),
|
|
151
|
+
last_name: z.string().optional().describe("Filter by last name"),
|
|
152
|
+
geo_urn: z.array(z.string()).optional().describe("LinkedIn geographic URNs (e.g. ['103644278'] for US)"),
|
|
153
|
+
current_company: z.array(z.string()).optional().describe("LinkedIn company URNs for current employer"),
|
|
154
|
+
industry: z.array(z.string()).optional().describe("LinkedIn industry URNs"),
|
|
155
|
+
past_company: z.array(z.string()).optional().describe("LinkedIn company URNs for past employer"),
|
|
156
|
+
school: z.string().optional().describe("Filter by school name (e.g. 'MIT')"),
|
|
157
|
+
profile_language: z.array(z.string()).optional().describe("Language codes (e.g. ['en'])"),
|
|
158
|
+
count: z.number().optional().describe("Number of profiles to return (default 25, max 50)"),
|
|
159
|
+
},
|
|
160
|
+
async (params) => {
|
|
161
|
+
const body: Record<string, unknown> = {};
|
|
162
|
+
if (params.keywords) body.keywords = params.keywords;
|
|
163
|
+
if (params.title) body.title = params.title;
|
|
164
|
+
if (params.company) body.company = params.company;
|
|
165
|
+
if (params.first_name) body.first_name = params.first_name;
|
|
166
|
+
if (params.last_name) body.last_name = params.last_name;
|
|
167
|
+
if (params.geo_urn) body.geo_urn = params.geo_urn;
|
|
168
|
+
if (params.current_company) body.current_company = params.current_company;
|
|
169
|
+
if (params.industry) body.industry = params.industry;
|
|
170
|
+
if (params.past_company) body.past_company = params.past_company;
|
|
171
|
+
if (params.school) body.school = params.school;
|
|
172
|
+
if (params.profile_language) body.profile_language = params.profile_language;
|
|
173
|
+
if (params.count) body.count = params.count;
|
|
174
|
+
|
|
175
|
+
const response = (await client.post("/linkedin-agent/search-profiles", body)) as {
|
|
176
|
+
api_agent_task_id: string;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
180
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
server.tool(
|
|
185
|
+
"linkedin_fetch_connections",
|
|
186
|
+
"Fetch your 1st-degree LinkedIn connections. Optionally filter by keyword, sort by recently added, and paginate. Connections are from your team's oldest admin member's LinkedIn account. Requires the OutX Chrome extension to be active. This tool handles async polling automatically.",
|
|
187
|
+
{
|
|
188
|
+
keyword: z.string().optional().describe("Filter connections by name (e.g. 'John')"),
|
|
189
|
+
sort_type: z.string().optional().describe("Sort order. Pass 'RECENTLY_ADDED' for newest first"),
|
|
190
|
+
start: z.number().optional().describe("Pagination offset (default 0)"),
|
|
191
|
+
count: z.number().optional().describe("Number of connections to return (default 40, max 100)"),
|
|
192
|
+
},
|
|
193
|
+
async (params) => {
|
|
194
|
+
const body: Record<string, unknown> = {};
|
|
195
|
+
if (params.keyword) body.keyword = params.keyword;
|
|
196
|
+
if (params.sort_type) body.sort_type = params.sort_type;
|
|
197
|
+
if (params.start !== undefined) body.start = params.start;
|
|
198
|
+
if (params.count) body.count = params.count;
|
|
199
|
+
|
|
200
|
+
const response = (await client.post("/linkedin-agent/fetch-connections", body)) as {
|
|
201
|
+
api_agent_task_id: string;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const result = await client.pollTask(response.api_agent_task_id);
|
|
205
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
|
|
85
209
|
server.tool(
|
|
86
210
|
"get_task_status",
|
|
87
211
|
"Check the status of an async LinkedIn Data API task. Use this to manually check tasks that timed out. Status values: pending, processing, completed, failed.",
|