Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions examples/extract-job-info-to-notion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: extract-job-info-to-notion
apiRevision: edurata.io/workflow/v1
description: Workflow to read a job description from a Notion page, extract key job details using GPT-3.5, and create a new job card in a Notion board.

interface:
inputs:
properties:
notion_page_id:
type: string
description: "The Notion page ID containing the job description."
default: "10de7e0f4b84809f8162c744000d9790"
notion_database_id:
type: string
description: "The Notion database ID where the job card will be created."
default: "112e7e0f4b848136ad0dfd17eee073a3"
outputs:
properties:
job_info:
type: object
description: "Extracted job information as JSON."
notion_card:
type: object
description: "The Notion card that was created."

steps:
get-job-description:
description: Retrieve the job description from Notion.
source:
repoUrl: "https://github.com/Edurata/edurata-functions.git"
path: etl/extract/get_job_description
props:
notion_page_id: ${inputs.notion_page_id}
notion_api_key: ${secrets.NOTION_API_KEY}

extract-job-info:
source:
repoUrl: "https://github.com/Edurata/edurata-functions.git"
path: etl/transform/extract_job_info
props:
job_description: ${get-job-description.job_description}
openai_api_key: ${secrets.OPENAI_API_KEY}

get-current-iso-time:
runtime: python3_10
code: |
import datetime

def handler(inputs):
return {
"iso_time": datetime.datetime.now().isoformat()
}

create-notion-card:
source:
repoUrl: "https://github.com/Edurata/edurata-functions.git"
path: etl/load/create_notion_card
props:
notion_api_key: ${secrets.NOTION_API_KEY}
notion_database_id: ${inputs.notion_database_id}
iso_time: ${get-current-iso-time.iso_time}
company_name: ${extract-job-info.job_info.company_name}
job_name: ${extract-job-info.job_info.job_name}
short_job_description: ${extract-job-info.job_info.short_job_description}
language: ${extract-job-info.job_info.language}
working_model: ${extract-job-info.job_info.working_model}
location: ${extract-job-info.job_info.location}
role: ${extract-job-info.job_info.role}
salary_expectation: ${extract-job-info.job_info.salary_expectation}
58 changes: 58 additions & 0 deletions examples/generate-blog-posts-from-airtable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: generate-blog-posts-from-airtable
apiRevision: edurata.io/workflow/v1
description: This workflow retrieves unprocessed blog posts from Airtable, generates blog content using OpenAI GPT, and updates the Airtable record with the generated content.

interface:
inputs:
type: object
properties:
airtable_base_id:
type: string
description: "The Airtable Base ID"
default: "appHMoJQ7Wlrx7pR6"
airtable_table_id:
type: string
description: "The Airtable Table ID"
default: "tblQOHK14nU4Rkw1j"

steps:
get-unprocessed-blogs:
description: Fetch unprocessed blog posts from Airtable.
source:
repoUrl: "https://github.com/Edurata/edurata-functions.git"
path: etl/extract/fetch_airtable_posts
props:
airtable_base_id: ${inputs.airtable_base_id}
airtable_table_id: ${inputs.airtable_table_id}
airtable_api_key: ${secrets.AIRTABLE_API_KEY}

generate-blog-content:
foreach: ${get-unprocessed-blogs.records}
description: Generate a professional blog post using OpenAI GPT.
source:
repoUrl: "https://github.com/Edurata/edurata-functions.git"
path: etl/transform/generate_gpt_content
props:
openai_api_key: ${secrets.OPENAI_API_KEY}
raw_content: ${each.fields.Raw Content}
record_id: ${each.id}
model: "gpt-4"
temperature: 0.7
messages:
- role: "system"
content: "You are an AI that generates professional blog posts from raw content."
- role: "user"
content: "Generate a well-structured, engaging blog post from this content:\n\n${each.fields.Raw Content}"

update-airtable:
foreach: ${generate-blog-content}
description: Update Airtable with generated blog content.
source:
repoUrl: "https://github.com/Edurata/edurata-functions.git"
path: etl/load/update_airtable_record
props:
airtable_base_id: ${inputs.airtable_base_id}
airtable_table_id: ${inputs.airtable_table_id}
record_id: ${each.id}
generated_content: ${each.generated_content}
airtable_api_key: ${secrets.AIRTABLE_API_KEY}