perplexity
Perplexity
AI-powered search and chat with Perplexity. Use when you need to: (1) get AI responses with real-time web search, or (2) answer questions with up-to-date information.
Input
Provide input as JSON:
{
"query": "Your search query or question"
}
Execution
Step 1: Run the Skill
refly skill run --id skpi-sww12wxvy9zbfr1wwx35gybm --input '{
"query": "Your question here"
}'
Step 2: Wait for Completion
refly workflow status c-xz42o3itzw4bdnnhoovb16dv --watch --interval 10000
Step 3: Get the Run ID
refly workflow runs c-xz42o3itzw4bdnnhoovb16dv --limit 1
Look for runId in the output (format: we-xxx).
Step 4: Get the Result ID
refly workflow detail <RUN_ID>
Look for resultId in the skillResponse node (format: ar-xxx).
Step 5: Extract the Content
refly workflow result <RESULT_ID> --include-messages --raw
The AI response is in .payload.messages[] where type is "ai". Extract with:
refly workflow result <RESULT_ID> --include-messages --raw | jq -r '.payload.messages[] | select(.type=="ai") | .content'
Alternative: One-liner (after Step 2)
RUN_ID=$(refly workflow runs c-xz42o3itzw4bdnnhoovb16dv --limit 1 | jq -r '.payload.runs[0].runId') && \
RESULT_ID=$(refly workflow detail "$RUN_ID" | jq -r '.payload.nodes[] | select(.nodeType=="skillResponse") | .resultId') && \
refly workflow result "$RESULT_ID" --include-messages --raw | jq -r '.payload.messages[] | select(.type=="ai") | .content'
Key Concepts
| ID Type | Format | How to Get | Used For |
|---|---|---|---|
| workflowId | c-xxx |
In SKILL.md frontmatter | workflow status, workflow runs |
| runId | we-xxx |
From workflow runs or workflow status output |
workflow detail, workflow toolcalls |
| resultId | ar-xxx |
From workflow detail → nodes[].resultId |
workflow result |
Common Mistakes to Avoid
Do NOT use toolcalls with .output.preview
# WRONG - This will fail!
refly workflow toolcalls <RUN_ID> --latest | jq -r '.payload.toolCalls[-1].output.preview | fromjson | .data.response'
Why it fails:
.output.previewmay benull→ jq error:null (null) only strings can be parsed.output.previewmay be truncated → jq error:Unfinished string at EOF- The preview field is not guaranteed to exist
Always use this instead:
refly workflow result <RESULT_ID> --include-messages --raw | jq -r '.payload.messages[] | select(.type=="ai") | .content'
Expected Output
- Type: Text content with citations
- Format: AI-generated response from Perplexity with web search results
- Action: Display content to user
More from refly-ai/refly-skills
kling-video
Generate AI videos using Kling video generation models. Use when you need to: (1) create videos from text prompts, (2) animate images into videos, (3) transform existing videos with AI, or (4) create AI avatar videos with speech.
137outlook
Integrate with Microsoft Outlook for email. Use when you need to: (1) send and manage emails, (2) create calendar events, or (3) automate email communication workflows.
86facebook
Integrate with Facebook for social media management. Use when you need to: (1) post updates to Facebook pages, (2) share content and media, or (3) automate Facebook page workflows.
77seedream-image
Generate AI images using ByteDance Seedream 4.5. Use when you need to: (1) create images from text descriptions, (2) transform images with style transfer, or (3) generate high-quality artistic or realistic images.
44google-maps
Integrate with Google Maps for location services. Use when you need to: (1) geocode addresses to coordinates, (2) search for places, or (3) get directions and location data.
41jina
Extract content from URLs and search with Jina. Use when you need to: (1) read and extract content from any URL, (2) perform site-specific searches, or (3) scrape web page content.
32