Notion recurring tasks

Hi,

I followed the steps in this YouTube video: How To Automate Tasks In Notion: Recurring Tasks the Simple Way..! - YouTube to set up recurring tasks in my notion database. But it doesn’t work. I think it is because my ID has only 32 characters instead of the required 36 characters.

I tried to extend the ID by insert hyphens at the end (5-b-6-7-16), but this still doesn’t work.

THANKS for your help!

Hello @dinaschulz, First of all, welcome to the Pipedream community.

Checking the video above, I see that you’re using Node.js code to interact with Notion, which is not maintained by the Pipedream team and will potentially be outdated.

I suggest that you replace the part of your Node.js code where you interact with Notion to use Pipedream’s built-in Notion actions instead.

If you need more help, you can describe your use case here and maybe I can recommend an approach to serve your needs.

Hey @vunguyenhung, thanks for your response.

I see the approaches from pipedream to interact with notion. Which one do you recommend to setup recurrings tasks in notion?

Thank you very much!

Hello @dinaschulz, as I understand, your needs is to have a new task added to your Notion Board at a specific recurring schedule (.e.g everyday at 14:00)

I would recommend you to create new Workflow, then

  1. Add Pipedream Interval Trigger and configure the desired schedule (in my case, everyday at 14:00, in GMT+7 timezone). Remember to tap Save and Continue to save the trigger

  2. Add the Pipedream action: Notion - Create Page from Database

  3. Connect Pipedream to your Notion account, please allow Pipedream to access your Notion database in the Oauth Popup. Then configure the Notion action, below is my example:

Tap to Test and wait for the action to execute, you should see a new task has been added to your Notion Board


Here’s the task content

My complete setup:

Please tell me if this doesn’t make sense to you! Thanks :pray:

We’ve just published a short 4 minute video that shows how to use this action:

Hi! I had this installed previously when using the “Done” checkbox, and it worked well. I recently converted my checkbox field into the status field (using the status as a checkbox, and still calling it the same “Done” property), and noted that this workflow is no longer working. I’m not very strong as far as programming language goes - any pointers you can give me on changing this to the status field would be much appreciated!

Hi @acorpron

First off, welcome to the Pipedream community. Happy to have you!

To help us understand the issue could you please share the specific error message you’re seeing? More details about what is triggering your workflow, the steps taken, and what the data looks like helps us understand where your issue is.

@pierce thanks for the response! I’m attaching a screenshot of the error. I’m fairly certain that it’s because I converted the “Done” checkbox into the newer status field (but am still using it as a checkbox for completed items). I just don’t know how to call the Status property within pipeline. Thanks for your help!

@pierce Here is a screenshot of the status property in my notion database and its setup. Thank you!

Hi @acorpron

A 400 error means that the data you’re sending to an external API doesn’t match what that API is expecting.

Please refer to the API’s documentation and the error message in the response from the API for more details to narrow down which part of the payload is missing or is malformed.

You’ll need to update your code to match the expected field in your Notion request.

Could you share your Node.js code that’s attempting to send this request?

Hi @pierce. Within the async (event, steps, params) => { brackets }.

/*******************************************************************************/
/*** DO NOT EDIT ANY CODE. ENTER YOUR CONFIGURATION VALUES IN THE FORM ABOVE ***/
/*******************************************************************************/

// Collect and assign user input
this.API_TOKEN = params.notionApiToken
this.DB_ID = params.taskDatabaseId
this.PROPS = {
  complete: params.completedPropertyName, // Type: Checkbox
  dueDate: params.dueDatePropertyName,    // Type: Date
  interval: params.intervalPropertyName   // Type: Select
}

this.INTERVALS = params.intervals && Object.keys(params.intervals).length > 0 ? params.intervals : {
  "daily" : [1, 'days'],
  "weekly" : [1, 'weeks'],
  "biweekly" : [2, 'weeks'],
  "monthly" : [1, 'months'],
  "quarterly" : [1, 'quarters'],
  "semi-Annually" : [6, 'months'],
  "annually" : [1, 'years']
}

// Validation
console.log('Validating user input...')
if (!/^secret_[\d|a-z|A-Z]+$/.test(this.API_TOKEN)) { throw new Error('Invalid Notion API token format')}
if (!/^[\d|a-f]{8}-?([\d|a-f]{4}-?){3}[\d|a-f]{12}$/.test(this.DB_ID)) { throw new Error('Invalid database ID format')}
const validIntervalUnits = ['days', 'weeks', 'months', 'quarters', 'years']
for (const interval in this.INTERVALS) {
  if (!(Array.isArray(this.INTERVALS[interval]) && this.INTERVALS[interval].length === 2)) { throw new Error(`Invalid recurring interval configuration for option: ${interval}.`)}
  if (!Number.isInteger(this.INTERVALS[interval][0])) { throw new Error(`Recurring interval must be an integer for option: ${interval}.`)}
  if (!(typeof this.INTERVALS[interval][1] === 'string' || this.INTERVALS[interval][1] instanceof String)) { throw new Error(`Recurring unit must be a string for option: ${interval}.`)}
  if (!validIntervalUnits.includes(this.INTERVALS[interval][1])) { throw new Error(`Recurring unit for option ${interval} must be one of: ${validIntervalUnits.join(', ')}.`)}
}
console.log('Validation complete!')

Hi @acorpron,

Looks like perhaps you’ve copied this workflow from a template.

I recommend reaching out to the maintainer of this workflow and asking for advice on how they would approach this modification.

Alternatively, you can reach out to a Pipedream Partner who can to help you with this change: https://pdrm.co/partner

Otherwise, I recommend trying to understand how the fields are passed and make the appropriate change to support a field change from a checkbox to a select.

Hi @pierce - I know it has to do with converting the “Done” checklist to the “status” field. Are you able to assist with that at all? Thanks…