Skip to content

A workflow to pull all messages from a slack channel from a specific date and add them to a google sheet and then send a private message to a slack user when its complete.

Notifications You must be signed in to change notification settings

zenaton-samples/slack-to-airtable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storing Slack messages to Airtable base table

Context

This example shows how to create a workflow that retrieves the latest messages from a Slack channel and stores the date, author and content in an Airtable table.

Requirements

  • A Zenaton account, APP id and API key
  • A Slack account with an app API key
  • A Airtable account with an API key and a table with this columns:
    • date (datetime)
    • from (string)
    • message (string)

Workflow Logic

Step by step workflow logic:

  • Retrieve the last N messages from a Slack channel
  • Retrieve the content of the Airtable table
  • Saves all Slack messages not present in Airtable

Dispatch

Dispatch this workflow by using the Zenaton graphQL API:

curl --request POST \
  --url 'https://gateway.zenaton.com/graphql' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <api Token>' \
  --data '
  {
    "query": "mutation($input: DispatchWorkflowInput!) { dispatchWorkflow(input: $input) { id } }",
    "variables": {
      "input": {
        "appId": "<app id>",
        "environment": "<environment>",
        "name": "slackToAirtableWorkflow",
	    "input": "[\"SLACK_CHANNEL\", \"30\", \"AIRTABLE_TABLE\", \"AIRTABLE_SHEET\"]"
      }
    }
  }'

You can also use the Zenaton scheduler to dispatch this workflow every day at 2PM:

curl --request POST \
  --url 'https://gateway.zenaton.com/graphql' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <api Token>' \
  --data '
  {
    "query": "mutation($input: ScheduleWorkflowInput!) { scheduleWorkflow(input: $input) { id } }",
    "variables": {
      "input": {
        "appId": "<app id>",
        "environment": "<environment>",
	    "cron": "0 2 * * *",
        "name": "slackToAirtableWorkflow",
	    "input": "[\"SLACK_CHANNEL\", \"30\", \"AIRTABLE_TABLE\", \"AIRTABLE_SHEET\"]"
      }
    }
  }'

Run on Heroku

Click this button Deploy, then fill in the env variables and click "deploy".

About

A workflow to pull all messages from a slack channel from a specific date and add them to a google sheet and then send a private message to a slack user when its complete.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published